Class: Burrow::Response
- Inherits:
-
Object
- Object
- Burrow::Response
- Defined in:
- lib/burrow/response.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(id, params) ⇒ Response
constructor
A new instance of Response.
- #json ⇒ Object
Constructor Details
#initialize(id, params) ⇒ Response
Returns a new instance of Response.
5 6 7 8 |
# File 'lib/burrow/response.rb', line 5 def initialize(id, params) @id = id @params = params end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/burrow/response.rb', line 3 def id @id end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/burrow/response.rb', line 3 def params @params end |
Instance Method Details
#attributes ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/burrow/response.rb', line 14 def attributes { id: id, result: params, jsonrpc: '2.0' } end |
#json ⇒ Object
10 11 12 |
# File 'lib/burrow/response.rb', line 10 def json JSON.generate(attributes) end |