Class: Rack::RPC::Endpoint::JSONRPC::Response
- Defined in:
- lib/rack/rpc/endpoint/jsonrpc.rb
Overview
JSON-RPC response objects.
Constant Summary
Constants inherited from Object
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.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from Object
Instance Method Summary collapse
Methods inherited from Object
Constructor Details
This class inherits a constructor from Rack::RPC::Endpoint::JSONRPC::Object
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
198 199 200 |
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 198 def error @error end |
#id ⇒ Object
Returns the value of attribute id.
199 200 201 |
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 199 def id @id end |
#result ⇒ Object
Returns the value of attribute result.
197 198 199 |
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 197 def result @result end |
#version ⇒ Object
Returns the value of attribute version.
196 197 198 |
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 196 def version @version end |
Instance Method Details
#to_hash ⇒ Hash
203 204 205 206 207 208 209 210 |
# File 'lib/rack/rpc/endpoint/jsonrpc.rb', line 203 def to_hash { :jsonrpc => (version || VERSION).to_s, :result => result, :error => error ? error.to_hash : nil, :id => id, } end |