Class: Rodzilla::JsonRpc::Response
- Inherits:
-
Object
- Object
- Rodzilla::JsonRpc::Response
- Defined in:
- lib/rodzilla/json_rpc/response.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#id ⇒ Object
Returns the value of attribute id.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize ⇒ Response
constructor
A new instance of Response.
- #read_http_response(http_response) ⇒ Object
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/rodzilla/json_rpc/response.rb', line 6 def initialize @error = nil end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
4 5 6 |
# File 'lib/rodzilla/json_rpc/response.rb', line 4 def error @error end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/rodzilla/json_rpc/response.rb', line 4 def id @id end |
#result ⇒ Object
Returns the value of attribute result.
4 5 6 |
# File 'lib/rodzilla/json_rpc/response.rb', line 4 def result @result end |
Instance Method Details
#read_http_response(http_response) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rodzilla/json_rpc/response.rb', line 10 def read_http_response(http_response) body = http_response.parsed_response @id = body["id"] @error = body["error"] @result = body["result"] self end |