Class: SurrealDB::None

Inherits:
Object
  • Object
show all
Defined in:
lib/surrealdb/models/none.rb

Overview

Represents the SurrealDB NONE value, which is distinct from NULL (nil). NONE indicates the absence of a value, while NULL is an explicit null.

Constant Summary collapse

INSTANCE =
new.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instanceObject



9
10
11
# File 'lib/surrealdb/models/none.rb', line 9

def self.instance
  INSTANCE
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



21
22
23
# File 'lib/surrealdb/models/none.rb', line 21

def ==(other)
  other.is_a?(None)
end

#hashObject



26
27
28
# File 'lib/surrealdb/models/none.rb', line 26

def hash
  self.class.hash
end

#inspectObject



13
14
15
# File 'lib/surrealdb/models/none.rb', line 13

def inspect
  'SurrealDB::NONE'
end

#nil?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/surrealdb/models/none.rb', line 30

def nil?
  false
end

#to_sObject



17
18
19
# File 'lib/surrealdb/models/none.rb', line 17

def to_s
  'NONE'
end