module Popcorn::Cast
Defined in:
popcorn/cast.crInstance Method Summary
- #raise_error!(source : String, target : String)
-
#to_bool(v : T) forall T
Returns the
Boolvalue represented by given data type. -
#to_bool?(v : T) forall T
Returns the
BoolorNilvalue represented by given data type. -
#to_float(v : T) forall T
Returns the
Floatvalue represented by given data type. -
#to_float32(v : T) forall T
Returns the
Float32value represented by given data type. -
#to_float32?(v : T) forall T
Returns the
Float32orNilvalue represented by given data type. -
#to_float64(v : T) forall T
Returns the
Float64value represented by given data type. -
#to_float64?(v : T) forall T
Alias to
#to_float64? -
#to_float?(v : T) forall T
Returns the
Float64orNilvalue represented by given data type. -
#to_int(v : T) forall T
Returns the
Intvalue represented by given data type. -
#to_int16(v : T) forall T
Returns the
Int16value represented by given data type. -
#to_int16?(v : T) forall T
Returns the
Int16orNilvalue represented by given data type. -
#to_int32(v : T) forall T
Returns the
Int32value represented by given data type. -
#to_int32?(v : T) forall T
Alias to
#to_int? -
#to_int64(v : T) forall T
Returns the
Int64value represented by given data type. -
#to_int64?(v : T) forall T
Returns the
Int64orNilvalue represented by given data type. -
#to_int8(v : T) forall T
Returns the
Int8value represented by given data type. -
#to_int8?(v : T) forall T
Returns the
Int8orNilvalue represented by given data type. -
#to_int?(v : T) forall T
Returns the
Int32orNilvalue represented by given data type. -
#to_time(v : T, location : Time::Location | Nil = nil, formatters : Array(String) | Nil = nil) forall T
Returns the
Timevalue represented by given data type. -
#to_time?(v : T, location : Time::Location | Nil = nil, formatters : Array(String) | Nil = nil) forall T
Returns the
TimeorNilvalue represented by given data type. -
#to_uint(v : T) forall T
Returns the
UIntvalue represented by given data type. -
#to_uint16(v : T) forall T
Returns the
UInt16value represented by given data type. -
#to_uint16?(v : T) forall T
Returns the
UInt16orNilvalue represented by given data type. -
#to_uint32(v : T) forall T
Returns the
UInt32value represented by given data type. -
#to_uint32?(v : T) forall T
Alias to
#to_uint? -
#to_uint64(v : T) forall T
Returns the
UInt64value represented by given data type. -
#to_uint64?(v : T) forall T
Returns the
UInt64orNilvalue represented by given data type. -
#to_uint8(v : T) forall T
Returns the
UInt8value represented by given data type. -
#to_uint8?(v : T) forall T
Returns the
Int8orNilvalue represented by given data type. -
#to_uint?(v : T) forall T
Returns the
UInt32orNilvalue represented by given data type.
Instance Method Detail
Returns the Bool or Nil value represented by given data type.
It accepts true, t, yes, y, on, 1, false, f, no, n, off, 0. Any other value return an error.
Returns the Time value represented by given data type.
Returns the Time or Nil value represented by given data type.