Class: Snap::Response
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Snap::Response
- Defined in:
- lib/snap/response.rb
Overview
Wraps HTTParty response so we can provide some helpful methods.
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #hydrate ⇒ Object
-
#initialize(response, model) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response, model) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/snap/response.rb', line 6 def initialize(response, model) @model = model super(response) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
10 11 12 |
# File 'lib/snap/response.rb', line 10 def model @model end |
Instance Method Details
#hydrate ⇒ Object
12 13 14 |
# File 'lib/snap/response.rb', line 12 def hydrate model.new(parsed_response) end |