Class: Architect::Plan
- Inherits:
-
Object
- Object
- Architect::Plan
- Defined in:
- lib/architect/plan.rb
Defined Under Namespace
Classes: InvalidPlanException
Instance Method Summary collapse
-
#initialize(path) ⇒ Plan
constructor
A new instance of Plan.
- #instances ⇒ Object
- #to_s ⇒ Object
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
#instances ⇒ Object
26 27 28 |
# File 'lib/architect/plan.rb', line 26 def instances @yaml['instances'] end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/architect/plan.rb', line 22 def to_s @yaml end |