Class: Pundit::ExpectedAttributeValues::UnexpectedValue
- Inherits:
-
NotAuthorizedError
- Object
- NotAuthorizedError
- Pundit::ExpectedAttributeValues::UnexpectedValue
- Defined in:
- lib/pundit/expected_attribute_values/errors.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(attribute:, value:, expected:) ⇒ UnexpectedValue
constructor
A new instance of UnexpectedValue.
Constructor Details
#initialize(attribute:, value:, expected:) ⇒ UnexpectedValue
Returns a new instance of UnexpectedValue.
8 9 10 11 12 13 14 15 16 |
# File 'lib/pundit/expected_attribute_values/errors.rb', line 8 def initialize(attribute:, value:, expected:) @attribute = attribute @value = value @expected = expected super( "Value #{value.inspect} is not expected for #{attribute}; " \ "expected: #{expected.inspect}" ) end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
6 7 8 |
# File 'lib/pundit/expected_attribute_values/errors.rb', line 6 def attribute @attribute end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
6 7 8 |
# File 'lib/pundit/expected_attribute_values/errors.rb', line 6 def expected @expected end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/pundit/expected_attribute_values/errors.rb', line 6 def value @value end |