abstract struct Ven::Suite::MStruct
- Ven::Suite::MStruct
- Struct
- Value
- Object
Overview
The parent of all Model
s represented by a Crystal struct.
Direct Known Subclasses
Defined in:
ven/suite/model.crConstructors
Instance Method Summary
-
#callable? : Bool
Returns whether this model is callable.
-
#eqv?(other : Model) : Bool
Returns whether this model is equal-by-value to the other model.
-
#field(name : String) : Model | Nil
Returns a field's value for this model (or nil if the field of interest does not exist).
- #initialize
-
#is_bool_false? : Bool
Returns whether this is a false
MBool
. -
#of?(other : MType) : Bool
Returns whether this model is of the type other.
-
#of?(other)
Returns whether this model is of the type other.
-
#to_bool(inverse = false) : MBool
Converts (casts) this model into an
MBool
. -
#to_num : Num
Converts (casts) this model into a
Num
. -
#to_str : Str
Converts (casts) this model into a
Str
. -
#to_vec : Vec
Converts (casts) this model into a
Vec
. -
#true? : Bool
Returns whether this model is semantically true.
-
#truth=(truth : Bool)
Temporarily assigns the truth to truth.
-
#truth?
Returns whether this model was yielded by a truthy expression:
false is false
=> false but is truthy, etc.
Constructor Detail
Instance Method Detail
Returns whether this model is equal-by-value to the other model.
Returns a field's value for this model (or nil if the field of interest does not exist).
Converts (casts) this model into an MBool
. Inverts
this MBool (applies not
) if inverse is true.