Class: Vagabond::CheffileLoader
- Inherits:
-
Object
- Object
- Vagabond::CheffileLoader
- Defined in:
- lib/vagabond/helpers/cheffile_loader.rb
Instance Attribute Summary collapse
-
#cookbooks ⇒ Object
readonly
Returns the value of attribute cookbooks.
Instance Method Summary collapse
- #cookbook(name, *args) ⇒ Object
-
#initialize(path = nil) ⇒ CheffileLoader
constructor
A new instance of CheffileLoader.
- #load(path) ⇒ Object
Constructor Details
#initialize(path = nil) ⇒ CheffileLoader
Returns a new instance of CheffileLoader.
6 7 8 9 |
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 6 def initialize(path=nil) @cookbooks = [] load(path) if path end |
Instance Attribute Details
#cookbooks ⇒ Object (readonly)
Returns the value of attribute cookbooks.
4 5 6 |
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 4 def cookbooks @cookbooks end |
Instance Method Details
#cookbook(name, *args) ⇒ Object
11 12 13 |
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 11 def cookbook(name, *args) cookbooks[name] = args end |
#load(path) ⇒ Object
15 16 17 |
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 15 def load(path) instance_eval(File.read(path)) end |