Class: CLI::Mastermind::ExecutablePlan

Inherits:
Object
  • Object
show all
Includes:
Plan
Defined in:
lib/cli/mastermind/executable_plan.rb

Overview

Executable Plan implementation. Used in Planfile Loader to generate executable plans from its DSL.

Instance Method Summary collapse

Methods included from Plan

#add_alias, #has_children?, included, #initialize

Instance Method Details

#call(options = nil) ⇒ Object

Implementation of Plan#call which calls the block this plan was created with

Parameters:

  • options (Array<String>, nil) (defaults to: nil)

    options passed from the command line

See Also:



12
13
14
15
16
17
# File 'lib/cli/mastermind/executable_plan.rb', line 12

def call(options=nil)
  case @block.arity
  when 1, -1 then instance_exec(options, &@block)
  else            instance_exec(&@block)
  end
end