Class: AbstractResp
- Inherits:
-
Object
- Object
- AbstractResp
- Defined in:
- lib/http/abstract_resp.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(body, request, response) ⇒ AbstractResp
constructor
A new instance of AbstractResp.
- #no ⇒ Object
- #obj ⇒ Object
- #ok ⇒ Object
Constructor Details
#initialize(body, request, response) ⇒ AbstractResp
Returns a new instance of AbstractResp.
4 5 6 |
# File 'lib/http/abstract_resp.rb', line 4 def initialize(body, request, response) @body, @request, @response = body, request, response end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
2 3 4 |
# File 'lib/http/abstract_resp.rb', line 2 def body @body end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
2 3 4 |
# File 'lib/http/abstract_resp.rb', line 2 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
2 3 4 |
# File 'lib/http/abstract_resp.rb', line 2 def response @response end |
Instance Method Details
#no ⇒ Object
15 |
# File 'lib/http/abstract_resp.rb', line 15 def no; self; end |
#obj ⇒ Object
8 9 10 11 12 |
# File 'lib/http/abstract_resp.rb', line 8 def obj JSON.parse(body.to_s) rescue JSON::ParserError body end |
#ok ⇒ Object
14 |
# File 'lib/http/abstract_resp.rb', line 14 def ok; self; end |