struct Luajit::LuaAny

Defined in:

luajit/lua_any.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(raw : Bool | Float64 | Luajit::LuaRef | String) #

[View source]

Instance Method Detail

def ==(other : JSON::Any) #

[View source]
def ==(other) #
Description copied from struct Struct

Returns true if this struct is equal to other.

Both structs' instance vars are compared to each other. Thus, two structs are considered equal if each of their instance variables are equal. Subclasses should override this method to provide specific equality semantics.

struct Point
  def initialize(@x : Int32, @y : Int32)
  end
end

p1 = Point.new 1, 2
p2 = Point.new 1, 2
p3 = Point.new 3, 4

p1 == p2 # => true
p1 == p3 # => false

[View source]
def as_bool : Bool #

[View source]
def as_bool? : Bool | Nil #

[View source]
def as_f : Float64 #

[View source]
def as_f? : Float64 | Nil #

[View source]
def as_ref : LuaRef #

[View source]
def as_ref? : LuaRef | Nil #

[View source]
def as_s : String #

[View source]
def as_s? : String | Nil #

[View source]
def hash(hasher) #
Description copied from struct Struct

See Object#hash(hasher)


[View source]
def inspect(io : IO) : Nil #
Description copied from struct Struct

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)"

[View source]
def raw : Type #

[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]