Module: Adama::Invoker::ClassMethods

Defined in:
lib/adama/invoker.rb

Overview

Our new class methods enable us to set the command list

Instance Method Summary collapse

Instance Method Details

#commandsObject

internal class method. So we can loop through the commands that have been assigned by the including class.



57
58
59
# File 'lib/adama/invoker.rb', line 57

def commands
  @commands ||= []
end

#invoke(*command_list) ⇒ Object

Public class method. Call invoke in your class definition to specify which commands will be executed.

class SuccessfulBusinessCreator

include Adama::Invoker

invoke(
  CollectUnderpantsCommand,
  MagicHappensCommand,
  ProfitCommand,
)

end



51
52
53
# File 'lib/adama/invoker.rb', line 51

def invoke(*command_list)
  @commands = command_list.flatten
end