Exception: Marvel::Response::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Marvel::Response::Error
- Defined in:
- lib/marvel/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(response_hash) ⇒ Error
Returns a new instance of Error.
6 7 8 9 |
# File 'lib/marvel/error.rb', line 6 def initialize(response_hash) @code = response_hash['code'] @status = response_hash['status'] || response_hash['message'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/marvel/error.rb', line 4 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/marvel/error.rb', line 4 def status @status end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/marvel/error.rb', line 11 def to_s "#{@code} #{@status}" end |