Module: Adama::Invoker::InvokeMethods
- Defined in:
- lib/adama/invoker.rb
Overview
Our new class methods enable us to set the command list
Instance Method Summary collapse
-
#commands ⇒ Object
internal class method.
-
#invoke(*command_list) ⇒ Object
Public class method.
Instance Method Details
#commands ⇒ Object
internal class method. So we can loop through the commands that have been assigned by the including class.
62 63 64 |
# File 'lib/adama/invoker.rb', line 62 def commands @commands ||= [] end |
#invoke(*command_list) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/adama/invoker.rb', line 52 def invoke(*command_list) if is_a?(Invoker) && self.class.commands.any? raise(StandardError, 'Can\'t call invoke on an Invoker instance \ with a class invocation list.') end @commands = command_list.flatten end |