Class: CopyBot::StepRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/copy_bot/step_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(step_name) ⇒ StepRunner

Returns a new instance of StepRunner.

Parameters:

  • step_name (String)


4
5
6
# File 'lib/copy_bot/step_runner.rb', line 4

def initialize(step_name)
  @step_name = step_name.to_sym
end

Instance Method Details

#callFalseClass, TrueClass

Returns:

  • (FalseClass, TrueClass)


9
10
11
12
13
14
15
16
# File 'lib/copy_bot/step_runner.rb', line 9

def call # rubocop:disable Metrics/AbcSize
  logger.info("Started step: #{step_name}")

  step.run

  step.success ? logger.info(step.message) : logger.debug(step.message)
  step.success
end