struct

Cling::Value

Inherits Struct < Value < Object

Represents a value for an argument or option.

Constructors

new(raw : Type)
Source

Instance methods

==(*args, **options)
Source
==(*args, **options, &)
Source
===(*args, **options)
Source
===(*args, **options, &)
Source
[](index : Int32) : Type

Indexes the value if the value is an array, otherwise raises an exception.

Source
[](index : Range) : Type

Attempts to index the value if the value is an array or returns nil, otherwise raises an exception.

Source
[](key : String) : Type

Indexes the value if the value is a hash, otherwise raises an exception.

Source
[]?(index : Int32) : Type

Attempts to index the value if the value is an array or returns nil, otherwise raises an exception.

Source
[]?(index : Range) : Type

Attempts to index the value if the value is an array or returns nil, otherwise raises an exception.

Source
[]?(key : String) : Type | Nil

Attempts to index the value if the value is a hash or returns nil, otherwise raises an exception.

Source
as_a

Returns the value as an Array. Note that this does not change the type of the array.

Source
as_a?

Returns the value as an Array. Note that this does not change the type of the array. Returns nil if the underlying value is not an array.

Source
as_bool

Returns the value as a Bool.

Source
as_bool?

Returns the value as a Bool or nil if the underlying value is not a boolean.

Source
as_dir

Returns the value as a Dir object. Note that this will raise an exception if the directory is not found.

Source
as_f

Returns the value as a Float.

Source
as_f32

Returns the value as a Float"32".

Source
as_f32?

Returns the value as a Float"32" or nil.

Source
as_f64

Returns the value as a Float"64".

Source
as_f64?

Returns the value as a Float"64" or nil.

Source
as_f?

Returns the value as a Float or nil if the underlying value is not a float.

Source
as_file

Returns the value as a File object. Note that this will raise an exception if the file is is not found.

Source
as_i

Returns the value as an Int.

Source
as_i128

Returns the value as an Int"128".

Source
as_i128?

Returns the value as an Int"128" or nil.

Source
as_i16

Returns the value as an Int"16".

Source
as_i16?

Returns the value as an Int"16" or nil.

Source
as_i32

Returns the value as an Int"32".

Source
as_i32?

Returns the value as an Int"32" or nil.

Source
as_i64

Returns the value as an Int"64".

Source
as_i64?

Returns the value as an Int"64" or nil.

Source
as_i8

Returns the value as an Int"8".

Source
as_i8?

Returns the value as an Int"8" or nil.

Source
as_i?

Returns the value as a Int or nil if the underlying value is not an integer.

Source
as_path

Returns the value as a Path object. This will attempt to resolve the value into a valid path (see Path.new).

Source
as_s

Returns the value as a String.

Source
as_s?

Returns the value as a String or nil if the underlying value is not a string.

Source
as_set

Returns the value as a Set. Note that this does not change the type of the set.

Source
as_time

Returns the value as a Time object. This will attempt to parse the value according to the matching time format, otherwise it will raise an exception (see Time.new).

Source
as_u128

Returns the value as a UInt"128".

Source
as_u128?

Returns the value as a UInt"128" or nil.

Source
as_u16

Returns the value as a UInt"16".

Source
as_u16?

Returns the value as a UInt"16" or nil.

Source
as_u32

Returns the value as a UInt"32".

Source
as_u32?

Returns the value as a UInt"32" or nil.

Source
as_u64

Returns the value as a UInt"64".

Source
as_u64?

Returns the value as a UInt"64" or nil.

Source
as_u8

Returns the value as a UInt"8".

Source
as_u8?

Returns the value as a UInt"8" or nil.

Source
size

Returns the size of the value if it is an array or hash, otherwise raises an exception.

Source
to_bool

Converts the value to a Bool.

Source
to_bool?

Converts the value to a Bool or Nil if the underlying value cannot be parsed.

Source
to_f

Converts the value to a Float.

Source
to_f32

Converts the value to a Float32.

Source
to_f32?

Converts the value to a Float32 or Nil if the underlying value cannot be parsed.

Source
to_f64

Converts the value to a Float64.

Source
to_f64?

Converts the value to a Float64 or Nil if the underlying value cannot be parsed.

Source
to_f?

Converts the value to a Float or Nil if the underlying value cannot be parsed.

Source
to_i

Conversts the value to an Int.

Source
to_i128

Converts the value to an Int128.

Source
to_i128?

Converts the value to an Int128 or Nil if the underlying value cannot be parsed.

Source
to_i16

Converts the value to an Int16.

Source
to_i16?

Converts the value to an Int16 or Nil if the underlying value cannot be parsed.

Source
to_i32

Converts the value to an Int32.

Source
to_i32?

Converts the value to an Int32 or Nil if the underlying value cannot be parsed.

Source
to_i64

Converts the value to an Int64.

Source
to_i64?

Converts the value to an Int64 or Nil if the underlying value cannot be parsed.

Source
to_i8

Converts the value to an Int8.

Source
to_i8?

Converts the value to an Int8 or Nil if the underlying value cannot be parsed.

Source
to_i?

Converts the value to an Int or Nil if the underlying value cannot be parsed.

Source
to_s(*args, **options)
Source
to_s(*args, **options, &)
Source
to_u128

Converts the value to a UInt128.

Source
to_u128?

Converts the value to a UInt128 or Nil if the underlying value cannot be parsed.

Source
to_u16

Converts the value to a UInt16.

Source
to_u16?

Converts the value to a UInt16 or Nil if the underlying value cannot be parsed.

Source
to_u32

Converts the value to a UInt32.

Source
to_u32?

Converts the value to a UInt32 or Nil if the underlying value cannot be parsed.

Source
to_u64

Converts the value to a UInt64.

Source
to_u64?

Converts the value to a UInt64 or Nil if the underlying value cannot be parsed.

Source
to_u8

Converts the value to a UInt8.

Source
to_u8?

Converts the value to a UInt8 or Nil if the underlying value cannot be parsed.

Source

Nested types