Module: EventSource::Postgres::Controls::Category

Defined in:
lib/event_source/postgres/controls/category.rb

Class Method Summary collapse

Class Method Details

.example(category: nil, randomize_category: nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/event_source/postgres/controls/category.rb', line 14

def self.example(category: nil, randomize_category: nil)
  if randomize_category.nil?
    if !category.nil?
      randomize_category = false
    end
  end

  randomize_category = true if randomize_category.nil?

  category ||= 'test'

  if randomize_category
    category = "#{category}#{SecureRandom.hex(16)}XX"
  end

  category
end