Class: Keepcon::Entity::Response
- Inherits:
-
Object
- Object
- Keepcon::Entity::Response
- Defined in:
- lib/keepcon/entity/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(http_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(http_response) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/keepcon/entity/response.rb', line 6 def initialize(http_response) self.body = http_response.body self.status = http_response.status end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/keepcon/entity/response.rb', line 4 def body @body end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/keepcon/entity/response.rb', line 4 def status @status end |
Instance Method Details
#data ⇒ Object
11 12 13 |
# File 'lib/keepcon/entity/response.rb', line 11 def data @data ||= (body.blank? && {}) || Hash.from_xml(body).first[1] end |