Exception: Grooveshark::ApiError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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



14
15
16
# File 'lib/grooveshark/errors.rb', line 14

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