Class: FDB::Tuple::UUID

Inherits:
Object
  • Object
show all
Defined in:
lib/fdbtuple.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ UUID

Returns a new instance of UUID.



47
48
49
50
51
52
# File 'lib/fdbtuple.rb', line 47

def initialize(data)
  if data.length != 16
    raise Error.new(2268) # invalid_uuid_size
  end
  @data=data.slice(0,16)
end

Instance Method Details

#<=>(other) ⇒ Object



56
57
58
# File 'lib/fdbtuple.rb', line 56

def <=> (other)
  self.data <=> other.data
end

#dataObject



53
54
55
# File 'lib/fdbtuple.rb', line 53

def data
  @data
end

#to_sObject



59
60
61
# File 'lib/fdbtuple.rb', line 59

def to_s
  self.data.each_byte.map { |b| b.to_s(16) } .join
end