Class: Mammoth::Commands::DeadLettersCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/mammoth/commands/dead_letters_command.rb

Overview

Reusable local command object for dead-letter inspection and replay.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv, lifecycle_hooks: LifecycleHooks.new) ⇒ DeadLettersCommand

Returns a new instance of DeadLettersCommand.

Parameters:

  • argv (Array<String>)

    dead-letters CLI-style arguments

  • lifecycle_hooks (Mammoth::LifecycleHooks, Hash) (defaults to: LifecycleHooks.new)

    local lifecycle callbacks



11
12
13
14
# File 'lib/mammoth/commands/dead_letters_command.rb', line 11

def initialize(argv, lifecycle_hooks: LifecycleHooks.new)
  @argv = argv
  @lifecycle_hooks = lifecycle_hooks
end

Instance Attribute Details

#argvObject (readonly)

Returns the value of attribute argv.



7
8
9
# File 'lib/mammoth/commands/dead_letters_command.rb', line 7

def argv
  @argv
end

#lifecycle_hooksObject (readonly)

Returns the value of attribute lifecycle_hooks.



7
8
9
# File 'lib/mammoth/commands/dead_letters_command.rb', line 7

def lifecycle_hooks
  @lifecycle_hooks
end

Instance Method Details

#callInteger

Returns process-style status code.

Returns:

  • (Integer)

    process-style status code



17
18
19
# File 'lib/mammoth/commands/dead_letters_command.rb', line 17

def call
  DeadLetterCommands.call(argv, lifecycle_hooks: lifecycle_hooks)
end