class MotherBrain::Gear::Base

Attributes

keyword[R]

The identifier for the Gear. The keyword is automatically populated based on the name of the Class including {MotherBrain::Gear}. The keyword must be unique among the other registered Gears. Also used to define a Gear in the plugin DSL.

@return [Symbol]

Public Class Methods

register_gear(keyword) click to toggle source

Register the gear with {MotherBrain::Gear} with the given keyword. This is how a gear is identified within a plugin.

@param [#to_sym] keyword

# File lib/mb/gear.rb, line 37
def register_gear(keyword)
  @keyword = keyword.to_sym
  Gear.register(self)
end

Public Instance Methods

run(job, environment, *args) click to toggle source

@param [MB::Job] job

a job to update with status

@param [String] environment

the environment this command is being run on
# File lib/mb/gear.rb, line 49
def run(job, environment, *args)
  raise AbstractFunction, "#run(environment, *args) must be implemented on #{self.class}"
end