Class: Battlestation::Plan
- Inherits:
-
Object
- Object
- Battlestation::Plan
- Defined in:
- lib/battlestation/plan.rb
Overview
This represents a complete Battlestation Plan, it may include checks and tasks.
Instance Attribute Summary collapse
-
#tasks ⇒ Object
Tasks to perform.
Instance Method Summary collapse
-
#initialize(opts = {}, &block) ⇒ Plan
constructor
Create a new plan.
-
#task(name, &block) ⇒ Object
(also: #dependency)
Adds a new task as a dependency.
Constructor Details
#initialize(opts = {}, &block) ⇒ Plan
Create a new plan.
16 17 18 19 |
# File 'lib/battlestation/plan.rb', line 16 def initialize(opts = {}, &block) @tasks = {} instance_eval &block if block_given? end |
Instance Attribute Details
#tasks ⇒ Object
Tasks to perform
6 7 8 |
# File 'lib/battlestation/plan.rb', line 6 def tasks @tasks end |
Instance Method Details
#task(name, &block) ⇒ Object Also known as: dependency
Adds a new task as a dependency.
22 23 24 |
# File 'lib/battlestation/plan.rb', line 22 def task(name, &block) tasks[name] = Battlestation::Task.new(name, &block) end |