# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'addressable/uri' require 'google/inflection' require 'google/api_client/discovery/method' module Google class APIClient ## # A resource that has been described by a discovery document. class Resource ## # Creates a description of a particular version of a resource. # # @param [Addressable::URI] base # The base URI for the service. # @param [String] resource_name # The identifier for the resource. # @param [Hash] resource_description # The section of the discovery document that applies to this resource. # # @return [Google::APIClient::Resource] The constructed resource object. def initialize(method_base, resource_name, discovery_document) @method_base = method_base @name = resource_name @discovery_document = discovery_document metaclass = (class <String representation of the resource's state. # # @return [String] The resource's state, as a String. def inspect sprintf( "#<%s:%#0x NAME:%s>", self.class.to_s, self.object_id, self.name ) end end end end