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? || body["errors"].nil? ? [] : body["errors"].map{ |error| symbolize_keys(error) } 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[:param].nil? ? e[:message] : "#{e[:param]}: #{e[:message]}" }.join(", ") end |