Module: EntitySnapshot::Postgres::StreamName

Extended by:
StreamName
Included in:
EntitySnapshot::Postgres, StreamName
Defined in:
lib/entity_snapshot/postgres/stream_name.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.category(entity_class) ⇒ Object



11
12
13
14
# File 'lib/entity_snapshot/postgres/stream_name.rb', line 11

def self.category(entity_class)
  *, entity_class_name = entity_class.name.split('::')
  Casing::Camel.(entity_class_name)
end

Instance Method Details

#snapshot_stream_name(id, category = nil) ⇒ Object



6
7
8
9
# File 'lib/entity_snapshot/postgres/stream_name.rb', line 6

def snapshot_stream_name(id, category=nil)
  category ||= self.category
  Messaging::StreamName.stream_name(id, category, type: 'snapshot')
end