Module: MessageStore::Postgres::Controls::MessageData::Write::List

Defined in:
lib/message_store/postgres/controls/message_data.rb

Defined Under Namespace

Classes: Entry

Class Method Summary collapse

Class Method Details

.get(instances: nil, stream_name: nil, category: nil) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/message_store/postgres/controls/message_data.rb', line 11

def self.get(instances: nil, stream_name: nil, category: nil)
  instances ||= 1

  list = []
  instances.times do
    instance_stream_name = stream_name || StreamName.example(category: category)
    instance_category = MessageStore::StreamName.get_category(instance_stream_name)

    write_message = Controls::MessageData::Write.example

    list << Entry.new(instance_stream_name, instance_category, write_message)
  end

  list
end