Module: Consumer::Postgres::PositionStore::StreamName

Defined in:
lib/consumer/postgres/position_store/stream_name.rb

Defined Under Namespace

Modules: Type

Class Method Summary collapse

Class Method Details

.get(stream_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/consumer/postgres/position_store/stream_name.rb', line 5

def self.get(stream_name)
  id = EventSource::Postgres::StreamName.get_id stream_name
  entity = EventSource::Postgres::StreamName.get_entity_name stream_name
  type_list = EventSource::Postgres::StreamName.get_types stream_name

  position_type = Type.get

  type_list << position_type unless type_list.include? position_type

  EventSource::Postgres::StreamName.stream_name(
    entity,
    id,
    types: type_list
  )
end