Exception: Ibanity::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Ibanity::Error
- Defined in:
- lib/ibanity/error.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(errors) ⇒ Error
Returns a new instance of Error.
5 6 7 |
# File 'lib/ibanity/error.rb', line 5 def initialize(errors) @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/ibanity/error.rb', line 3 def errors @errors end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/ibanity/error.rb', line 9 def to_s @errors.map do |error| if error["attribute"] "* #{error["code"]}: '#{error["attribute"]}' #{error["message"]}" else "* #{error["code"]}: #{error["message"]}" end end.join("\n") end |