Class: Takeoff::Plan::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/takeoff/plan/base.rb

Direct Known Subclasses

Default

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_plan(name, &block) ⇒ Object



10
11
12
13
# File 'lib/takeoff/plan/base.rb', line 10

def build_plan(name, &block)
  plan = Class.new(self, &block)
  Plan.const_set(name.to_s.camelize, plan)
end

.envObject



23
24
25
# File 'lib/takeoff/plan/base.rb', line 23

def env
  @env ||= default_env
end

.launch(env = {}) ⇒ Object



27
28
29
# File 'lib/takeoff/plan/base.rb', line 27

def launch(env = {})
  new.launch(env)
end

.stages(&block) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/takeoff/plan/base.rb', line 15

def stages(&block)
  @stages ||= default_stages

  @stages.instance_eval(&block) if block

  @stages
end

Instance Method Details

#launch(env = {}) ⇒ Object



56
57
58
59
# File 'lib/takeoff/plan/base.rb', line 56

def launch(env = {})
  env = self.class.env.merge(env)
  self.class.stages.call(env)
end