class CrSerializer::Assertions::EqualToAssertion(ActualValueType)
- CrSerializer::Assertions::EqualToAssertion(ActualValueType)
- CrSerializer::Assertions::Assertion
- Reference
- Object
Overview
Validates a property is equal to a value
Usable on all data types
@[Assert::EqualTo(value: 7)]
property age : Int64
NOTE For nil assertion see IsNilAssertion
Defined in:
CrSerializer/assertions/equal_to.crConstructors
Instance Method Summary
-
#actual
The current value of the property
-
#error_message : String
The message that will be shown if the assertion is not valid
-
#valid? : Bool
Returns true if the provided property passes the assertion, otherwise false.
Instance methods inherited from class CrSerializer::Assertions::Assertion
error_message : String
error_message,
field : String
field,
valid? : Bool
valid?
Constructor methods inherited from class CrSerializer::Assertions::Assertion
new(field : String, message : String | Nil)
new
Constructor Detail
def self.new(field : String, message : String | Nil, actual : ActualValueType, value : ActualValueType)
#
Instance Method Detail
def valid? : Bool
#
Description copied from class CrSerializer::Assertions::Assertion
Returns true if the provided property passes the assertion, otherwise false.
TODO make this abstract once this issue is resolved.