Class: Architect::Plan

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

Defined Under Namespace

Classes: InvalidPlanException

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Plan

Returns a new instance of Plan.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/architect/plan.rb', line 9

def initialize(path)
  case path.kind_of?
  when String
    @yaml = YAML.load_file(path)
  when Hash
    @yaml = path
  else
    raise ArgumentError
  end

  validate
end

Instance Method Details

#instancesObject



26
27
28
# File 'lib/architect/plan.rb', line 26

def instances
  @yaml['instances']
end

#to_sObject



22
23
24
# File 'lib/architect/plan.rb', line 22

def to_s
  @yaml
end