Exception: Kiik::KiikError
- Inherits:
-
StandardError
- Object
- StandardError
- Kiik::KiikError
- Defined in:
- lib/kiik/error.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(body = nil) ⇒ KiikError
constructor
A new instance of KiikError.
- #to_s ⇒ Object
Constructor Details
#initialize(body = nil) ⇒ KiikError
Returns a new instance of KiikError.
4 5 6 |
# File 'lib/kiik/error.rb', line 4 def initialize(body = nil) @errors = body.nil? ? [] : [{attr: body['error']['param'], message: body['error']['message']}] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/kiik/error.rb', line 3 def errors @errors end |
Instance Method Details
#to_s ⇒ Object
8 9 10 |
# File 'lib/kiik/error.rb', line 8 def to_s @errors.map{ |e| e[:message] }.join(", ") end |