Added support for API feature lists.

This commit is contained in:
Bob Aman 2011-08-08 17:23:59 -04:00
parent b4745890f5
commit 9a2217a6bb
1 changed files with 19 additions and 1 deletions

View File

@ -96,7 +96,25 @@ module Google
# @return [TrueClass, FalseClass] # @return [TrueClass, FalseClass]
# Whether or not this is the preferred version of this API. # Whether or not this is the preferred version of this API.
def preferred def preferred
return @discovery_document['preferred'] return !!@discovery_document['preferred']
end
##
# Returns the list of API features.
#
# @return [Array]
# The features supported by this API.
def features
return @discovery_document['features'] || []
end
##
# Returns true if this API uses a data wrapper.
#
# @return [TrueClass, FalseClass]
# Whether or not this API uses a data wrapper.
def data_wrapper?
return self.features.include?('dataWrapper')
end end
## ##