Chem::Metadata::Any
Inherits Struct / Value / Object
Any wraps a value that can be any of the possible metadata
types (ValueType). It provides convenient #as_* cast methods.
Constructors
Instance methods
Returns true if the enclosed values are equal, else false.
Chem::Metadata::Any.new("123") == Chem::Metadata::Any.new("123") # => true
Chem::Metadata::Any.new("123") == Chem::Metadata::Any.new(123) # => false
Returns true if the enclosed value is equal to rhs, else false.
Chem::Metadata::Any.new("123") == "123" # => true
Chem::Metadata::Any.new("123") == 123 # => false
Returns the enclosed value as a nested array of Int32. Raises
TypeCastError if it's not a nested array of Int32.
Returns the enclosed value as a nested array of Float64. Raises
TypeCastError if it's not a nested array of Float64.
Returns the enclosed value as a nested array of String. Raises
TypeCastError if it's not a nested array of String.
Returns the enclosed value as a nested array of Bool. Raises
TypeCastError if it's not a nested array of Bool.
Returns the enclosed value as an nested array of Int32, or
nil if it's not an nested array of Int32.
Returns the enclosed value as an nested array of Float64, or
nil if it's not an nested array of Float64.
Returns the enclosed value as an nested array of String, or
nil if it's not an nested array of String.
Returns the enclosed value as an nested array of Bool, or
nil if it's not an nested array of Bool.
Returns the enclosed value as an array of Int32. Raises
TypeCastError if it's not an array of Int32.
Returns the enclosed value as an array of Float64. Raises
TypeCastError if it's not an array of Float64.
Returns the enclosed value as an array of String. Raises
TypeCastError if it's not an array of String.
Returns the enclosed value as an array of Bool. Raises
TypeCastError if it's not an array of Bool.
Returns the enclosed value as an array of Any. Raises
TypeCastError if it's not an array.
Returns the enclosed value as an array of Int32, or nil if
it's not an array of Int32.
Returns the enclosed value as an array of Float64, or nil if
it's not an array of Float64.
Returns the enclosed value as an array of String, or nil if
it's not an array of String.
Returns the enclosed value as an array of Bool, or nil if
it's not an array of Bool.
Appends this struct's name and instance variables names and values to the given IO.
struct Point
def initialize(@x : Int32, @y : Int32)
end
end
p1 = Point.new 1, 2
p1.to_s # "Point(@x=1, @y=2)"
p1.inspect # "Point(@x=1, @y=2)"