struct Ven::Suite::MString

Overview

Ven's string data type.

Defined in:

ven/suite/model.cr

Constructors

Instance Method Summary

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

def self.new(value) #

[View source]

Instance Method Detail

def []?(index : Int) #
Description copied from struct Ven::Suite::MStruct

Returns index-th item of this model.

Subclasses should rather override this method instead of nth.


[View source]
def []?(range : Range) #
Description copied from struct Ven::Suite::MStruct

Returns a subset of items in this model.

Subclasses should rather override this method instead of nth.


[View source]
def callable? #
Description copied from struct Ven::Suite::MStruct

Returns whether this model is callable.


[View source]
def indexable? #
Description copied from struct Ven::Suite::MStruct

Returns whether this model is indexable (i.e., properly implements nth).


[View source]
def length #
Description copied from struct Ven::Suite::MStruct

Returns the length (#) of this model.


[View source]
def to_num(parse = true) #

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.


[View source]
def to_s(io) #

[View source]
def to_str #
Description copied from struct Ven::Suite::MStruct

Converts (casts) this model into a Str.


[View source]
def true? #
Description copied from struct Ven::Suite::MStruct

Returns whether this model is semantically true.


[View source]