class Marten::Schema::Field::Bool
- Marten::Schema::Field::Bool
- Marten::Schema::Field::Base
- Reference
- Object
Overview
Represents a boolean schema field.
Defined in:
marten/schema/field.crmarten/schema/field/bool.cr
Instance Method Summary
-
#deserialize(value) : ::Bool
Deserializes a raw field value to the corresponding field value.
-
#empty_value?(value) : ::Bool
Returns
true
if the value is considered empty by the field. -
#serialize(value) : ::String | Nil
Serializes a field value.
Instance methods inherited from class Marten::Schema::Field::Base
deserialize(value)
deserialize,
empty_value?(value) : ::Bool
empty_value?,
id : String
id,
required? : Bool
required?,
serialize(value) : ::String | Nil
serialize,
validate(schema, value)
validate
Constructor methods inherited from class Marten::Schema::Field::Base
new(id : ::String, required : ::Bool = true)
new
Instance Method Detail
def deserialize(value) : ::Bool
#
Description copied from class Marten::Schema::Field::Base
Deserializes a raw field value to the corresponding field value.
def empty_value?(value) : ::Bool
#
Description copied from class Marten::Schema::Field::Base
Returns true
if the value is considered empty by the field.
def serialize(value) : ::String | Nil
#
Description copied from class Marten::Schema::Field::Base
Serializes a field value.