Exception: ValidatorFn::Error
- Inherits:
-
StandardError
- Object
- StandardError
- ValidatorFn::Error
- Defined in:
- lib/validator_fn/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#my_msg ⇒ Object
readonly
Returns the value of attribute my_msg.
Instance Method Summary collapse
-
#initialize(msg) ⇒ Error
constructor
A new instance of Error.
- #message(indent = 0) ⇒ Object
Constructor Details
#initialize(msg) ⇒ Error
Returns a new instance of Error.
5 6 7 8 |
# File 'lib/validator_fn/error.rb', line 5 def initialize(msg) @my_msg = msg super(msg) end |
Instance Attribute Details
#my_msg ⇒ Object (readonly)
Returns the value of attribute my_msg.
3 4 5 |
# File 'lib/validator_fn/error.rb', line 3 def my_msg @my_msg end |
Instance Method Details
#message(indent = 0) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/validator_fn/error.rb', line 10 def (indent = 0) if cause cause_msg = if cause.kind_of?(Error) cause.(indent + 1) else cause. end my_msg + "\n" + (" " * (indent + 1)) + cause_msg else my_msg end end |