Module: AggregateStreams::Controls::Handler

Defined in:
lib/aggregate_streams/controls/handler.rb

Class Method Summary collapse

Class Method Details

.example(category: nil, snapshot: nil, snapshot_interval: nil, session: nil, writer_session: nil, &transform_action) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/aggregate_streams/controls/handler.rb', line 4

def self.example(category: nil, snapshot: nil, snapshot_interval: nil, session: nil, writer_session: nil, &transform_action)
  if category == :none
    category = nil
  else
    category ||= Category.example
  end

  settings_data = {}

  settings_data[:category] = category unless category.nil?
  settings_data[:snapshot_interval] = snapshot_interval unless snapshot_interval.nil?
  settings_data[:writer_session] = writer_session unless writer_session.nil?
  settings_data[:transform_action] = transform_action unless transform_action.nil?

  settings = Settings.build(settings_data)

  Handle.build(session: session, settings: settings)
end