Class: MotherBrain::CommandRunner::InvokableComponent Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mb/command_runner.rb

Overview

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.

Proxy for invoking components in the DSL

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job, environment, component) ⇒ InvokableComponent

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 InvokableComponent.

Parameters:

  • job (Job)
  • environment (String)

    the environment on which to eventually invoke a command

  • component (Component)

    the component we’ll be invoking



220
221
222
223
224
# File 'lib/mb/command_runner.rb', line 220

def initialize(job, environment, component)
  @job = job
  @environment = environment
  @component   = component
end

Instance Attribute Details

#componentObject (readonly)

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.



214
215
216
# File 'lib/mb/command_runner.rb', line 214

def component
  @component
end

#environmentObject (readonly)

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.



213
214
215
# File 'lib/mb/command_runner.rb', line 213

def environment
  @environment
end

#jobObject (readonly)

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.



212
213
214
# File 'lib/mb/command_runner.rb', line 212

def job
  @job
end

Instance Method Details

#invoke(command, *args) ⇒ Object

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.

Parameters:

  • command (String)

    the command to invoke in the component

  • args (Array)

    additional arguments for the command



228
229
230
# File 'lib/mb/command_runner.rb', line 228

def invoke(command, *args)
  component.invoke(job, environment, command, args)
end