Exception: PlaylyfeError
- Inherits:
-
StandardError
- Object
- StandardError
- PlaylyfeError
- Defined in:
- lib/playlyfe.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(res) ⇒ PlaylyfeError
constructor
A new instance of PlaylyfeError.
Constructor Details
#initialize(res) ⇒ PlaylyfeError
Returns a new instance of PlaylyfeError.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/playlyfe.rb', line 8 def initialize(res) = [] begin @raw = res res = JSON.parse(res) @name = res['error'] @message = res['error_description'] << "#{@code}: #{@description}" rescue => e end super(.join("\n")) end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
7 8 9 |
# File 'lib/playlyfe.rb', line 7 def @message end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/playlyfe.rb', line 7 def name @name end |