Exception: Trafaret::Error
- Inherits:
-
Exception
- Object
- Exception
- Trafaret::Error
- Defined in:
- lib/trafaret/errors.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(message) ⇒ Error
constructor
A new instance of Error.
- #inspect ⇒ Object
Constructor Details
#initialize(message) ⇒ Error
Returns a new instance of Error.
5 6 7 |
# File 'lib/trafaret/errors.rb', line 5 def initialize() @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/trafaret/errors.rb', line 3 def @message end |
Instance Method Details
#dump ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/trafaret/errors.rb', line 13 def dump case @message when ::Hash Hash[@message.map { |k, v| [k, v.dump] }] when ::Array @message.map &:dump else @message end end |
#inspect ⇒ Object
9 10 11 |
# File 'lib/trafaret/errors.rb', line 9 def inspect "#<Trafaret::Error(#{.inspect})>" end |