struct Ven::Suite::MString
- Ven::Suite::MString
- Ven::Suite::MValue(String)
- Ven::Suite::MStruct
- Struct
- Value
- Object
Overview
Ven's string data type.
Defined in:
ven/suite/model.crConstructors
Instance Method Summary
-
#[]?(index : Int)
Returns index-th item of this model.
-
#[]?(range : Range)
Returns a subset of items in this model.
-
#callable?
Returns whether this model is callable.
-
#indexable?
Returns whether this model is indexable (i.e., properly implements
nth
). -
#length
Returns the length (#) of this model.
-
#to_num(parse = true)
Returns this string parsed into a
Num
. - #to_s(io)
-
#to_str
Converts (casts) this model into a
Str
. -
#true?
Returns whether this model is semantically true.
Instance methods inherited from struct Ven::Suite::MValue(String)
eqv?(other : MValue)
eqv?,
to_s(io)
to_s,
value : T
value
Constructor methods inherited from struct Ven::Suite::MValue(String)
new(value : T)
new
Instance methods inherited from struct Ven::Suite::MStruct
[]=(referent : Model, value : Model) : Model | Nil
[]=,
[]?(index : Int)[]?(index : Range) []?, callable? : Bool callable?, eqv?(other : Model) : Bool eqv?, false? : Bool false?, field(name : String) : Model | Nil field, indexable? indexable?, initialize initialize, length : Int32 length, match(other : Model) match, nth(index : Num)
nth(range : MRange)
nth(other) nth, of?(other : MType) : Bool
of?(other : MAny)
of?(other) of?, set_referent(referent : Model, value : Model) : Model set_referent, to_bool(inverse = false) : MBool to_bool, to_num : Num to_num, to_str : Str to_str, to_vec : Vec to_vec, true? : Bool true?, weight : MWeight weight
Constructor methods inherited from struct Ven::Suite::MStruct
new
new
Constructor Detail
Instance Method Detail
Returns index-th item of this model.
Subclasses should rather override this method instead
of nth
.
Returns a subset of items in this model.
Subclasses should rather override this method instead
of nth
.
Returns whether this model is callable.
Returns whether this model is indexable (i.e., properly
implements nth
).
Returns the length (#) of this model.
Returns this string parsed into a Num
. Alternatively,
if parse is false, returns the length of this string.
Raises a ModelCastException
if this string could not
be parsed into a number.
Converts (casts) this model into a Str
.
Returns whether this model is semantically true.