Exception: Counterparty::ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- Counterparty::ResponseError
- Defined in:
- lib/counterparty_ruby.rb
Overview
This exception comes from an error relating to a proper request, but an inability to complete the request via the counterpartyd api
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data_args ⇒ Object
readonly
Returns the value of attribute data_args.
-
#data_message ⇒ Object
readonly
Returns the value of attribute data_message.
-
#data_type ⇒ Object
readonly
Returns the value of attribute data_type.
-
#message_class ⇒ Object
readonly
Returns the value of attribute message_class.
Instance Method Summary collapse
-
#initialize(json) ⇒ ResponseError
constructor
A new instance of ResponseError.
- #message ⇒ Object
Constructor Details
#initialize(json) ⇒ ResponseError
Returns a new instance of ResponseError.
34 35 36 37 38 39 40 41 42 |
# File 'lib/counterparty_ruby.rb', line 34 def initialize(json) , @code = json['message'], json['code'] json['data'].each_pair do |(k,v)| instance_variable_set '@data_%s' % k, v end if json.has_key? 'data' super end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
31 32 33 |
# File 'lib/counterparty_ruby.rb', line 31 def code @code end |
#data_args ⇒ Object (readonly)
Returns the value of attribute data_args.
29 30 31 |
# File 'lib/counterparty_ruby.rb', line 29 def data_args @data_args end |
#data_message ⇒ Object (readonly)
Returns the value of attribute data_message.
30 31 32 |
# File 'lib/counterparty_ruby.rb', line 30 def end |
#data_type ⇒ Object (readonly)
Returns the value of attribute data_type.
28 29 30 |
# File 'lib/counterparty_ruby.rb', line 28 def data_type @data_type end |
#message_class ⇒ Object (readonly)
Returns the value of attribute message_class.
32 33 34 |
# File 'lib/counterparty_ruby.rb', line 32 def end |
Instance Method Details
#message ⇒ Object
44 45 46 |
# File 'lib/counterparty_ruby.rb', line 44 def '%s: %s' % [,] end |