Module: Euston::AggregateRootPrivateMethodNames::ClassMethods

Defined in:
lib/euston/aggregate_root_private_method_names.rb

Instance Method Summary collapse

Instance Method Details

#applies_method_name(event, version) ⇒ Object



6
7
8
# File 'lib/euston/aggregate_root_private_method_names.rb', line 6

def applies_method_name event, version
  "__apply__#{event}__v#{version}__"
end

#consumes_method_name(command, version) ⇒ Object



10
11
12
# File 'lib/euston/aggregate_root_private_method_names.rb', line 10

def consumes_method_name command, version
  "__consume__#{command}__v#{version}__"
end

#consumes_regexObject



14
15
16
# File 'lib/euston/aggregate_root_private_method_names.rb', line 14

def consumes_regex
  /__consume__(\w+)__v(\d+)__/
end

#id_from_event_method_name(type, version) ⇒ Object



18
19
20
# File 'lib/euston/aggregate_root_private_method_names.rb', line 18

def id_from_event_method_name type, version
  "__id_from_event_#{type}__v#{version}__"
end

#load_snapshot_method_name(version) ⇒ Object



22
23
24
# File 'lib/euston/aggregate_root_private_method_names.rb', line 22

def load_snapshot_method_name version
  "__load_snapshot__v#{version}__"
end

#take_snapshot_method_name(version) ⇒ Object



26
27
28
# File 'lib/euston/aggregate_root_private_method_names.rb', line 26

def take_snapshot_method_name version
  "__take_snapshot__v#{version}__"
end

#take_snapshot_regexpObject



30
31
32
# File 'lib/euston/aggregate_root_private_method_names.rb', line 30

def take_snapshot_regexp
  /__take_snapshot__v(\d+)__/
end