Exception: Grooveshark::ApiError
- Inherits:
-
Exception
- Object
- Exception
- Grooveshark::ApiError
- Defined in:
- lib/grooveshark/errors.rb
Overview
Api error
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.
16 17 18 19 |
# File 'lib/grooveshark/errors.rb', line 16 def initialize(fault) @code = fault['code'] @message = fault['message'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
14 15 16 |
# File 'lib/grooveshark/errors.rb', line 14 def code @code end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/grooveshark/errors.rb', line 21 def to_s "#{@code} - #{@message}" end |