Exception: Rools::RuleError
- Inherits:
-
StandardError
- Object
- StandardError
- Rools::RuleError
- Defined in:
- lib/rools/errors.rb
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) inner_error
readonly
Returns the value of attribute inner_error.
-
- (Object) rule
readonly
Returns the value of attribute rule.
Instance Method Summary (collapse)
-
- (RuleError) initialize(rule, inner_error = nil)
constructor
Pass the Rools::Rule that caused the error, and an optional inner_error.
-
- (Object) to_s
returns the name of the associated Rools::Rule, and the message of the inner_error.
Constructor Details
- (RuleError) initialize(rule, inner_error = nil)
Pass the Rools::Rule that caused the error, and an optional inner_error
7 8 9 10 |
# File 'lib/rools/errors.rb', line 7 def initialize(rule, inner_error = nil) @rule = rule @inner_error = inner_error end |
Instance Attribute Details
- (Object) inner_error (readonly)
Returns the value of attribute inner_error
4 5 6 |
# File 'lib/rools/errors.rb', line 4 def inner_error @inner_error end |
- (Object) rule (readonly)
Returns the value of attribute rule
4 5 6 |
# File 'lib/rools/errors.rb', line 4 def rule @rule end |
Instance Method Details
- (Object) to_s
returns the name of the associated Rools::Rule, and the message of the inner_error
13 14 15 |
# File 'lib/rools/errors.rb', line 13 def to_s "#{@rule.name}\n#{@inner_error.to_s}" end |