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.
33 34 35 36 37 38 39 40 41 |
# File 'lib/counterparty_ruby.rb', line 33 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.
30 31 32 |
# File 'lib/counterparty_ruby.rb', line 30 def code @code end |
#data_args ⇒ Object (readonly)
Returns the value of attribute data_args.
28 29 30 |
# File 'lib/counterparty_ruby.rb', line 28 def data_args @data_args end |
#data_message ⇒ Object (readonly)
Returns the value of attribute data_message.
29 30 31 |
# File 'lib/counterparty_ruby.rb', line 29 def end |
#data_type ⇒ Object (readonly)
Returns the value of attribute data_type.
27 28 29 |
# File 'lib/counterparty_ruby.rb', line 27 def data_type @data_type end |
#message_class ⇒ Object (readonly)
Returns the value of attribute message_class.
31 32 33 |
# File 'lib/counterparty_ruby.rb', line 31 def end |
Instance Method Details
#message ⇒ Object
43 44 45 |
# File 'lib/counterparty_ruby.rb', line 43 def '%s: %s' % [,] end |