Expose discovery doc in prep for future doc changes

This commit is contained in:
Steven Bazyl 2012-10-04 15:48:21 -07:00
parent c2d64a2484
commit 3dcd88a884
3 changed files with 25 additions and 14 deletions

View File

@ -53,6 +53,9 @@ module Google
end end
end end
end end
# @return [String] unparsed discovery document for the API
attr_reader :discovery_document
## ##
# Returns the id of the service. # Returns the id of the service.

View File

@ -45,6 +45,9 @@ module Google
@discovery_document = discovery_document @discovery_document = discovery_document
end end
# @return [String] unparsed discovery document for the method
attr_reader :discovery_document
## ##
# Returns the API this method belongs to. # Returns the API this method belongs to.
# #
@ -57,13 +60,6 @@ module Google
# @return [String] The method identifier. # @return [String] The method identifier.
attr_reader :name attr_reader :name
##
# Returns the parsed section of the discovery document that applies to
# this method.
#
# @return [Hash] The method description.
attr_reader :description
## ##
# Returns the base URI for the method. # Returns the base URI for the method.
# #
@ -81,6 +77,14 @@ module Google
@uri_template = nil @uri_template = nil
end end
##
# Returns a human-readable description of the method.
#
# @return [Hash] The API description.
def description
return @discovery_document['description']
end
## ##
# Returns the method ID. # Returns the method ID.
# #

View File

@ -58,25 +58,29 @@ module Google
end end
end end
# @return [String] unparsed discovery document for the resource
attr_reader :discovery_document
## ##
# Returns the identifier for the resource. # Returns the identifier for the resource.
# #
# @return [String] The resource identifier. # @return [String] The resource identifier.
attr_reader :name attr_reader :name
##
# Returns the parsed section of the discovery document that applies to
# this resource.
#
# @return [Hash] The resource description.
attr_reader :description
## ##
# Returns the base URI for this resource. # Returns the base URI for this resource.
# #
# @return [Addressable::URI] The base URI that methods are joined to. # @return [Addressable::URI] The base URI that methods are joined to.
attr_reader :method_base attr_reader :method_base
##
# Returns a human-readable description of the resource.
#
# @return [Hash] The API description.
def description
return @discovery_document['description']
end
## ##
# Updates the hierarchy of resources and methods with the new base. # Updates the hierarchy of resources and methods with the new base.
# #