Class: Zoid::Response
- Inherits:
-
Object
- Object
- Zoid::Response
- Defined in:
- lib/zoid/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, body) ⇒ Response
constructor
A new instance of Response.
- #process(value) ⇒ Object
- #process_array(array) ⇒ Object
- #process_hash(hash) ⇒ Object
Constructor Details
#initialize(status, body) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/zoid/response.rb', line 6 def initialize(status, body) @status = status @body = process(body) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/zoid/response.rb', line 4 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/zoid/response.rb', line 3 def status @status end |
Instance Method Details
#process(value) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/zoid/response.rb', line 11 def process(value) case value when Array then process_array(value) when Hash then process_hash(value) else value end end |