Exception: Grooveshark::ApiError
- Inherits:
-
Exception
- Object
- Exception
- Grooveshark::ApiError
- Defined in:
- lib/grooveshark/errors.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(fault) ⇒ ApiError
constructor
A new instance of ApiError.
- #to_s ⇒ Object
Constructor Details
#initialize(fault) ⇒ ApiError
Returns a new instance of ApiError.
9 10 11 12 |
# File 'lib/grooveshark/errors.rb', line 9 def initialize(fault) @code = fault['code'] @message = fault['message'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'lib/grooveshark/errors.rb', line 7 def code @code end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/grooveshark/errors.rb', line 14 def to_s "#{@code} - #{@message}" end |