Class: Serverkit::Recipe
- Inherits:
-
Object
- Object
- Serverkit::Recipe
- Defined in:
- lib/serverkit/recipe.rb
Class Method Summary collapse
Instance Method Summary collapse
- #hosts ⇒ Array<String>
-
#initialize(raw_recipe) ⇒ Recipe
constructor
A new instance of Recipe.
- #resources ⇒ Array<Serverkit::Resources::Base>
-
#ssh? ⇒ true, false
Flag to use SSH (default: true).
Constructor Details
#initialize(raw_recipe) ⇒ Recipe
Returns a new instance of Recipe.
20 21 22 |
# File 'lib/serverkit/recipe.rb', line 20 def initialize(raw_recipe) @raw_recipe = raw_recipe end |
Class Method Details
.load_from_path(path) ⇒ Object
13 14 15 16 |
# File 'lib/serverkit/recipe.rb', line 13 def load_from_path(path) raw_recipe = YAML.load_file(path) new(raw_recipe) end |
Instance Method Details
#hosts ⇒ Array<String>
33 34 35 |
# File 'lib/serverkit/recipe.rb', line 33 def hosts @raw_recipe["hosts"] end |
#resources ⇒ Array<Serverkit::Resources::Base>
TODO:
Delegate to resource builder
26 27 28 29 30 |
# File 'lib/serverkit/recipe.rb', line 26 def resources @resources ||= resource_properties.map do |properties| Resources.const_get(properties["type"].camelize, false).new(properties) end end |
#ssh? ⇒ true, false
Returns Flag to use SSH (default: true).
38 39 40 |
# File 'lib/serverkit/recipe.rb', line 38 def ssh? @raw_recipe["ssh"] != false end |