Assert::Assertions::IsTrue(PropertyType)
Inherits Assert::Assertions::Assertion / Reference / Object
Validates a property is true.
Example
class Example
include Assert
def initialize; end
@[Assert::IsTrue]
property bool : Bool = true
@[Assert::IsTrue]
property nilable_bool : Bool? = nil
end
Example.new.valid? # => true
Constructors
new(property_name : String, actual : Union(Bool, Nil), message : String | Nil = nil, groups : Array(String) | Nil = nil)
SourceInstance methods
default_message_template
Returns the default #message_template to use if no message is provided.
message
The message to display if self is not valid.
NOTE: This method is defined automatically, and is just present for documentation purposes.