abstract struct ReQL::AbstractValue
- ReQL::AbstractValue
- Struct
- Value
- Object
Included Modules
- Comparable(Object)
Direct Known Subclasses
Defined in:
reql/executor/abstract_value.cr:8reql/executor/abstract_value.cr:14
Constructors
Instance Method Summary
-
#<=>(other : AbstractValue)
The comparison operator.
- #<=>(other) : Int32
- #array_or_nil_value
- #array_or_set_or_nil_value
- #array_or_set_value
- #array_or_set_value?
- #array_value
- #array_value?
- #as_database
- #as_datum
- #as_function
- #as_row
- #as_table
- #bool_or_nil_value
- #bool_value
- #bool_value?
- #bytes_or_nil_value
- #bytes_value
- #bytes_value?
- #each(&)
- #float64_value
- #hash_or_nil_value
- #hash_value
- #hash_value?
- #initialize
- #int64_value
- #is_array?
- #is_array_or_set?
- #is_bool?
- #is_bytes?
- #is_hash?
- #is_number?
- #is_set?
- #is_string?
- #number_or_nil_value
- #number_value
- #number_value?
- #serialize
- #set_or_nil_value
- #set_value
- #set_value?
- #string_or_nil_value
- #string_value
- #string_value?
- #to_json(io)
- #value : Type
Macro Summary
Instance methods inherited from class Object
!=(other : RethinkDB::DSL::R)
!=,
%(other : RethinkDB::DSL::R)
%,
&(other : RethinkDB::DSL::R)
&,
*(other : RethinkDB::DSL::R)
*,
+(other : RethinkDB::DSL::R)
+,
-(other : RethinkDB::DSL::R)
-,
/(other : RethinkDB::DSL::R)
/,
<(other : RethinkDB::DSL::R)
<,
<=(other : RethinkDB::DSL::R)
<=,
==(other : RethinkDB::DSL::R)
==,
>(other : RethinkDB::DSL::R)
>,
>=(other : RethinkDB::DSL::R)
>=,
|(other : RethinkDB::DSL::R)
|
Constructor Detail
Instance Method Detail
def <=>(other : AbstractValue)
#
Description copied from module Comparable(Object)
The comparison operator. Returns 0
if the two objects are equal,
a negative number if this object is considered less than other,
a positive number if this object is considered greater than other,
or nil
if the two objects are not comparable.
Subclasses define this method to provide class-specific ordering.
The comparison operator is usually used to sort values:
# Sort in a descending way:
[3, 1, 2].sort { |x, y| y <=> x } # => [3, 2, 1]
# Sort in an ascending way:
[3, 1, 2].sort { |x, y| x <=> y } # => [1, 2, 3]