Class: SimpleEventSourcing::Id::UUIDId

Inherits:
BaseId
  • Object
show all
Defined in:
lib/simple_event_sourcing/aggregate_root/id.rb

Instance Attribute Summary

Attributes inherited from BaseId

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseId

#==, #to_s

Constructor Details

#initialize(value) ⇒ UUIDId

Returns a new instance of UUIDId.



27
28
29
30
# File 'lib/simple_event_sourcing/aggregate_root/id.rb', line 27

def initialize(value)
  raise UUIDValidationError unless valid? value
  super(value)
end

Class Method Details

.generateObject



32
33
34
# File 'lib/simple_event_sourcing/aggregate_root/id.rb', line 32

def self.generate
  new SecureRandom.uuid
end