Merge remote branch 'remotes/upstream/master'

This commit is contained in:
Martin Sarsale committed 2011-11-30 11:39:28 -03:00
commit f736ac4d97
21 files changed
+339 -4599

No files matched your search

+28 -1
View File
@@ -35,7 +35,8 @@ module Google
# The section of the discovery document that applies to this method.
#
# @return [Google::APIClient::Method] The constructed method object.
def initialize(method_base, method_name, discovery_document)
def initialize(api, method_base, method_name, discovery_document)
@api = api
@method_base = method_base
@name = method_name
@discovery_document = discovery_document
@@ -102,6 +103,32 @@ module Google
)
end
##
# Returns the Schema object for the method's request, if any.
#
# @return [Google::APIClient::Schema] The request schema.
def request_schema
if @discovery_document['request']
schema_name = @discovery_document['request']['$ref']
return @api.schemas[schema_name]
else
return nil
end
end
##
# Returns the Schema object for the method's response, if any.
#
# @return [Google::APIClient::Schema] The response schema.
def response_schema
if @discovery_document['response']
schema_name = @discovery_document['response']['$ref']
return @api.schemas[schema_name]
else
return nil
end
end
##
# Normalizes parameters, converting to the appropriate types.
#