Class: Warren::App::ConsumerStart

Inherits:
Object
  • Object
show all
Defined in:
lib/warren/app/consumer_start.rb

Overview

Handles the initial creation of the configuration object

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shell, options) ⇒ ConsumerStart

Returns a new instance of ConsumerStart.



25
26
27
28
29
# File 'lib/warren/app/consumer_start.rb', line 25

def initialize(shell, options)
  @shell = shell
  @config = Warren::Config::Consumers.new(options[:path])
  @consumers = options[:consumers]
end

Class Method Details

.invoke(shell, options) ⇒ Void

Starts up a warren client process for the configured consumers.

Parameters:

  • shell (Thor::Shell::Basic)

    Thor shell instance for feedback

  • options (Hash)

    Hash of command line arguments from Thor

Options Hash (options):

  • :path (String)

    Path to the ‘warren_consumers.yml `file

  • :consumers (Array<String>)

    Array of configured consumers to start. Defaults to all consumers

Returns:

  • (Void)


21
22
23
# File 'lib/warren/app/consumer_start.rb', line 21

def self.invoke(shell, options)
  new(shell, options).invoke
end

Instance Method Details

#invokeVoid

Starts up a warren client process for the configured consumers.

Returns:

  • (Void)


35
36
37
# File 'lib/warren/app/consumer_start.rb', line 35

def invoke
  Warren::Client.new(@config, consumers: @consumers).run
end