Class: Mammoth::Commands::StartCommand
- Inherits:
-
Object
- Object
- Mammoth::Commands::StartCommand
- Defined in:
- lib/mammoth/commands/start_command.rb
Overview
Starts a Mammoth application and prints the processed work count.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#lifecycle_hooks ⇒ Object
readonly
Returns the value of attribute lifecycle_hooks.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#call ⇒ Integer
Process-style status code.
-
#initialize(config, source: nil, output: $stdout, lifecycle_hooks: LifecycleHooks.new) ⇒ StartCommand
constructor
A new instance of StartCommand.
Constructor Details
#initialize(config, source: nil, output: $stdout, lifecycle_hooks: LifecycleHooks.new) ⇒ StartCommand
Returns a new instance of StartCommand.
13 14 15 16 17 18 |
# File 'lib/mammoth/commands/start_command.rb', line 13 def initialize(config, source: nil, output: $stdout, lifecycle_hooks: LifecycleHooks.new) @config = config @source = source @output = output @lifecycle_hooks = lifecycle_hooks end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/mammoth/commands/start_command.rb', line 7 def config @config end |
#lifecycle_hooks ⇒ Object (readonly)
Returns the value of attribute lifecycle_hooks.
7 8 9 |
# File 'lib/mammoth/commands/start_command.rb', line 7 def lifecycle_hooks @lifecycle_hooks end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/mammoth/commands/start_command.rb', line 7 def output @output end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/mammoth/commands/start_command.rb', line 7 def source @source end |
Instance Method Details
#call ⇒ Integer
Returns process-style status code.
21 22 23 24 25 |
# File 'lib/mammoth/commands/start_command.rb', line 21 def call processed = Application.new(config, source: source, lifecycle_hooks: lifecycle_hooks).start output.puts "Processed events: #{processed}" 0 end |