Exception: Keratin::ClientError
- Defined in:
- lib/keratin/client.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors) ⇒ ClientError
constructor
A new instance of ClientError.
Constructor Details
#initialize(errors) ⇒ ClientError
Returns a new instance of ClientError.
17 18 19 20 21 22 23 24 |
# File 'lib/keratin/client.rb', line 17 def initialize(errors) @errors = errors.map{|e| [e['field'], e['message']] } .group_by(&:first) .map{|k, v| [k, v.map(&:last)] } .to_h super(@errors.inspect) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
15 16 17 |
# File 'lib/keratin/client.rb', line 15 def errors @errors end |