Represents a value for an argument or option.
Instance methods
===(*args, **options, &)
SourceIndexes the value if the value is an array, otherwise raises an exception.
SourceAttempts to index the value if the value is an array or returns nil, otherwise raises an
exception.
SourceIndexes 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.
Sourceas_a
Returns the value as an Array. Note that this does not change the type of the array.
Sourceas_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.
Sourceas_bool
Returns the value as a Bool.
Sourceas_bool?
Returns the value as a Bool or nil if the underlying value is not a boolean.
Sourceas_dir
Returns the value as a Dir object. Note that this will raise an exception if the directory
is not found.
Sourceas_f
Returns the value as a Float.
Sourceas_f32
Returns the value as a Float"32".
Sourceas_f32?
Returns the value as a Float"32" or nil.
Sourceas_f64
Returns the value as a Float"64".
Sourceas_f64?
Returns the value as a Float"64" or nil.
Sourceas_f?
Returns the value as a Float or nil if the underlying value is not a float.
Sourceas_file
Returns the value as a File object. Note that this will raise an exception if the file is
is not found.
Sourceas_i
Returns the value as an Int.
Sourceas_i128
Returns the value as an Int"128".
Sourceas_i128?
Returns the value as an Int"128" or nil.
Sourceas_i16
Returns the value as an Int"16".
Sourceas_i16?
Returns the value as an Int"16" or nil.
Sourceas_i32
Returns the value as an Int"32".
Sourceas_i32?
Returns the value as an Int"32" or nil.
Sourceas_i64
Returns the value as an Int"64".
Sourceas_i64?
Returns the value as an Int"64" or nil.
Sourceas_i8
Returns the value as an Int"8".
Sourceas_i8?
Returns the value as an Int"8" or nil.
Sourceas_i?
Returns the value as a Int or nil if the underlying value is not an integer.
Sourceas_path
Returns the value as a Path object. This will attempt to resolve the value into a valid
path (see Path.new).
Sourceas_s
Returns the value as a String.
Sourceas_s?
Returns the value as a String or nil if the underlying value is not a string.
Sourceas_set
Returns the value as a Set. Note that this does not change the type of the set.
Sourceas_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).
Sourceas_u128
Returns the value as a UInt"128".
Sourceas_u128?
Returns the value as a UInt"128" or nil.
Sourceas_u16
Returns the value as a UInt"16".
Sourceas_u16?
Returns the value as a UInt"16" or nil.
Sourceas_u32
Returns the value as a UInt"32".
Sourceas_u32?
Returns the value as a UInt"32" or nil.
Sourceas_u64
Returns the value as a UInt"64".
Sourceas_u64?
Returns the value as a UInt"64" or nil.
Sourceas_u8
Returns the value as a UInt"8".
Sourceas_u8?
Returns the value as a UInt"8" or nil.
Sourcesize
Returns the size of the value if it is an array or hash, otherwise raises an exception.
Sourceto_bool
Converts the value to a Bool.
Sourceto_bool?
Converts the value to a Bool or Nil if the underlying value cannot be parsed.
Sourceto_f
Converts the value to a Float.
Sourceto_f32
Converts the value to a Float32.
Sourceto_f32?
Converts the value to a Float32 or Nil if the underlying value cannot be parsed.
Sourceto_f64
Converts the value to a Float64.
Sourceto_f64?
Converts the value to a Float64 or Nil if the underlying value cannot be parsed.
Sourceto_f?
Converts the value to a Float or Nil if the underlying value cannot be parsed.
Sourceto_i
Conversts the value to an Int.
Sourceto_i128
Converts the value to an Int128.
Sourceto_i128?
Converts the value to an Int128 or Nil if the underlying value cannot be parsed.
Sourceto_i16
Converts the value to an Int16.
Sourceto_i16?
Converts the value to an Int16 or Nil if the underlying value cannot be parsed.
Sourceto_i32
Converts the value to an Int32.
Sourceto_i32?
Converts the value to an Int32 or Nil if the underlying value cannot be parsed.
Sourceto_i64
Converts the value to an Int64.
Sourceto_i64?
Converts the value to an Int64 or Nil if the underlying value cannot be parsed.
Sourceto_i8
Converts the value to an Int8.
Sourceto_i8?
Converts the value to an Int8 or Nil if the underlying value cannot be parsed.
Sourceto_i?
Converts the value to an Int or Nil if the underlying value cannot be parsed.
Sourceto_s(*args, **options, &)
Sourceto_u128
Converts the value to a UInt128.
Sourceto_u128?
Converts the value to a UInt128 or Nil if the underlying value cannot be parsed.
Sourceto_u16
Converts the value to a UInt16.
Sourceto_u16?
Converts the value to a UInt16 or Nil if the underlying value cannot be parsed.
Sourceto_u32
Converts the value to a UInt32.
Sourceto_u32?
Converts the value to a UInt32 or Nil if the underlying value cannot be parsed.
Sourceto_u64
Converts the value to a UInt64.
Sourceto_u64?
Converts the value to a UInt64 or Nil if the underlying value cannot be parsed.
Sourceto_u8
Converts the value to a UInt8.
Sourceto_u8?
Converts the value to a UInt8 or Nil if the underlying value cannot be parsed.
Source