Exception: Jidoka::ArgumentClassMismatch
- Inherits:
-
StandardError
- Object
- StandardError
- Jidoka::ArgumentClassMismatch
- Defined in:
- lib/jidoka/errors.rb
Overview
Raised when enforce_arguments! validation fails
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
Instance Method Summary collapse
-
#initialize(argument, expected:, actual:) ⇒ ArgumentClassMismatch
constructor
A new instance of ArgumentClassMismatch.
Constructor Details
#initialize(argument, expected:, actual:) ⇒ ArgumentClassMismatch
Returns a new instance of ArgumentClassMismatch.
11 12 13 14 15 16 |
# File 'lib/jidoka/errors.rb', line 11 def initialize(argument, expected:, actual:) @param = argument @expected = expected @actual = actual super("#{param} was expected to be a(n) #{@expected} but was a(n) #{@actual || 'nil'}") end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
9 10 11 |
# File 'lib/jidoka/errors.rb', line 9 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
9 10 11 |
# File 'lib/jidoka/errors.rb', line 9 def expected @expected end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
9 10 11 |
# File 'lib/jidoka/errors.rb', line 9 def param @param end |