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