Exception: Saorin::RPCError
- Includes:
- Dumpable
- Defined in:
- lib/saorin/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(message, options = {}) ⇒ RPCError
constructor
A new instance of RPCError.
- #to_h ⇒ Object
Methods included from Dumpable
Constructor Details
#initialize(message, options = {}) ⇒ RPCError
Returns a new instance of RPCError.
12 13 14 15 16 |
# File 'lib/saorin/error.rb', line 12 def initialize(, = {}) super @code = [:code] @data = [:data] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/saorin/error.rb', line 10 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/saorin/error.rb', line 10 def data @data end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/saorin/error.rb', line 18 def to_h h = {} h['code'] = code h['message'] = h['data'] = data if data h end |