Class: Neo4j::Driver::Types::UUID

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/driver/types/uuid.rb

Overview

A Neo4j UUID value (Bolt 6.1+). An opaque, immutable value type mirroring java.util.UUID (which JRuby uses natively) and Python's uuid.UUID — construct via from_string, read the canonical hyphenated form via to_s. new is private so flavor-agnostic code goes through from_string, the one constructor that also exists on java.util.UUID.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ UUID

Returns a new instance of UUID.



16
17
18
# File 'lib/neo4j/driver/types/uuid.rb', line 16

def initialize(value)
  @value = value.to_s
end

Class Method Details

.from_string(value) ⇒ Object



13
# File 'lib/neo4j/driver/types/uuid.rb', line 13

def self.from_string(value) = new(value)

Instance Method Details

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



22
# File 'lib/neo4j/driver/types/uuid.rb', line 22

def ==(other) = other.is_a?(UUID) && other.to_s == @value

#hashObject



25
# File 'lib/neo4j/driver/types/uuid.rb', line 25

def hash = @value.hash

#to_sObject



20
# File 'lib/neo4j/driver/types/uuid.rb', line 20

def to_s = @value