Exception: JSONServer::JSONRPCError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- JSONServer::JSONRPCError
- Defined in:
- lib/json_server.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(obj = {}) ⇒ JSONRPCError
constructor
A new instance of JSONRPCError.
Constructor Details
#initialize(obj = {}) ⇒ JSONRPCError
Returns a new instance of JSONRPCError.
9 10 11 12 13 |
# File 'lib/json_server.rb', line 9 def initialize obj = {} @code = obj[:code] || -30000 @message = obj[:message] || "Runtime Error" @data = obj[:data] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/json_server.rb', line 8 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/json_server.rb', line 8 def data @data end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/json_server.rb', line 8 def @message end |