Class: MotherBrain::CommandRunner::CleanRoom Private

Inherits:
MotherBrain::CleanRoomBase show all
Defined in:
lib/mb/command_runner.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from MotherBrain::CleanRoomBase

dsl_attr_writer

Methods included from Logging

add_argument_header, dev, filename, #log_exception, logger, #logger, reset, set_logger, setup

Constructor Details

#initialize(*args) ⇒ CleanRoom

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CleanRoom.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/mb/command_runner.rb', line 176

def initialize(*args)
  super
  @actions = Array.new

  Gear.all.each do |klass|
    clean_room = self

    klass.instance_eval do
      define_method :run, ->(job, *args, &block) do
        clean_room.send(:actions) << action = action(job, *args, &block)
        action
      end
    end
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MotherBrain::CleanRoomBase