Class: HomeAway::API::Response
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- HomeAway::API::Response
- Defined in:
- lib/homeaway/api/response.rb
Overview
A container around the response that the HomeAway API returns. This object extends Hashie::Mash and can be accessed in an identical method
Instance Method Summary collapse
-
#_metadata ⇒ HomeAway::API::Response
Returns information about the request that was just made.
- #convert_key(key) ⇒ Object
-
#has?(*attrs) ⇒ Boolean
a helper method to determine if this response has any particular fields in its payload, potentially nested.
Instance Method Details
#_metadata ⇒ HomeAway::API::Response
Returns information about the request that was just made. This includes things such as connection headers and status code
44 45 46 |
# File 'lib/homeaway/api/response.rb', line 44 def @metadata ||= HomeAway::API::Response.new end |
#convert_key(key) ⇒ Object
23 24 25 |
# File 'lib/homeaway/api/response.rb', line 23 def convert_key(key) #:nodoc: HomeAway::API::Util::Validators.camel_case(key) end |
#has?(*attrs) ⇒ Boolean
a helper method to determine if this response has any particular fields in its payload, potentially nested
32 33 34 35 36 37 38 39 |
# File 'lib/homeaway/api/response.rb', line 32 def has?(*attrs) entity = self attrs.each do |attr| return false unless entity.has_key?(attr.to_sym) entity = entity.send(attr.to_sym) end true end |