Exception: Grooveshark::ApiError

Inherits:
Exception
  • Object
show all
Defined in:
lib/grooveshark/errors.rb

Overview

Api error

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (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_sObject



21
22
23
# File 'lib/grooveshark/errors.rb', line 21

def to_s
  "#{@code} - #{@message}"
end