struct

RethinkDB::Datum

Inherits Struct / Value / Object

Constructors

new(value : ReQL::Datum | Datum | Array | Set | Bool | Float64 | Hash | NamedTuple | Int64 | Int32 | Time | String | Nil | Bytes | ReQL::Maxval | ReQL::Minval, runopts : RunOpts)
Source

Instance methods

!=(other)

Returns true if this object is not equal to other.

By default this method is implemented as !(self == other) so there's no need to override this unless there's a more efficient way to do it.

Source
==(other)

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
Source
array
Source
array?
Source
bool
Source
bool?
Source
bytes
Source
bytes?
Source
datum
Source
float
Source
float?
Source
hash

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with == by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.

Source
hash?
Source
inspect(io)
Source
int32
Source
int32?
Source
int64
Source
int64?
Source
string
Source
string?
Source
to_json(io)
Source
value
Source