module Popcorn::Cast
Defined in:
popcorn/cast.crInstance Method Summary
- #raise_error!(source : String, target : String)
-
#to_bool(v : T) forall T
Returns the
Bool
value represented by given data type. -
#to_bool?(v : T) forall T
Returns the
Bool
orNil
value represented by given data type. -
#to_float(v : T) forall T
Returns the
Float
value represented by given data type. -
#to_float32(v : T) forall T
Returns the
Float32
value represented by given data type. -
#to_float32?(v : T) forall T
Returns the
Float32
orNil
value represented by given data type. -
#to_float64(v : T) forall T
Returns the
Float64
value represented by given data type. -
#to_float64?(v : T) forall T
Alias to
#to_float64?
-
#to_float?(v : T) forall T
Returns the
Float64
orNil
value represented by given data type. -
#to_int(v : T) forall T
Returns the
Int
value represented by given data type. -
#to_int16(v : T) forall T
Returns the
Int16
value represented by given data type. -
#to_int16?(v : T) forall T
Returns the
Int16
orNil
value represented by given data type. -
#to_int32(v : T) forall T
Returns the
Int32
value represented by given data type. -
#to_int32?(v : T) forall T
Alias to
#to_int?
-
#to_int64(v : T) forall T
Returns the
Int64
value represented by given data type. -
#to_int64?(v : T) forall T
Returns the
Int64
orNil
value represented by given data type. -
#to_int8(v : T) forall T
Returns the
Int8
value represented by given data type. -
#to_int8?(v : T) forall T
Returns the
Int8
orNil
value represented by given data type. -
#to_int?(v : T) forall T
Returns the
Int32
orNil
value represented by given data type. -
#to_time(v : T, location : Time::Location | Nil = nil, formatters : Array(String) | Nil = nil) forall T
Returns the
Time
value represented by given data type. -
#to_time?(v : T, location : Time::Location | Nil = nil, formatters : Array(String) | Nil = nil) forall T
Returns the
Time
orNil
value represented by given data type. -
#to_uint(v : T) forall T
Returns the
UInt
value represented by given data type. -
#to_uint16(v : T) forall T
Returns the
UInt16
value represented by given data type. -
#to_uint16?(v : T) forall T
Returns the
UInt16
orNil
value represented by given data type. -
#to_uint32(v : T) forall T
Returns the
UInt32
value represented by given data type. -
#to_uint32?(v : T) forall T
Alias to
#to_uint?
-
#to_uint64(v : T) forall T
Returns the
UInt64
value represented by given data type. -
#to_uint64?(v : T) forall T
Returns the
UInt64
orNil
value represented by given data type. -
#to_uint8(v : T) forall T
Returns the
UInt8
value represented by given data type. -
#to_uint8?(v : T) forall T
Returns the
Int8
orNil
value represented by given data type. -
#to_uint?(v : T) forall T
Returns the
UInt32
orNil
value 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.