Class: Ladder::Cookbooks::Cookbook
- Inherits:
-
Object
- Object
- Ladder::Cookbooks::Cookbook
- Defined in:
- lib/chef/ladder/cookbooks.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, source) ⇒ Cookbook
constructor
A new instance of Cookbook.
Constructor Details
#initialize(name, source) ⇒ Cookbook
Returns a new instance of Cookbook.
17 18 19 20 |
# File 'lib/chef/ladder/cookbooks.rb', line 17 def initialize(name, source) @name = name @source = source end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
22 23 24 |
# File 'lib/chef/ladder/cookbooks.rb', line 22 def name @name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
23 24 25 |
# File 'lib/chef/ladder/cookbooks.rb', line 23 def source @source end |
Class Method Details
.create(name, options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/chef/ladder/cookbooks.rb', line 5 def self.create(name, ) if .has_key? :path return LocalCookbook.new(name, [:path]) elsif .has_key? :git return GitCookbook.new(name, [:git]) elsif .has_key? :github return GithubCookbook.new(name, [:github]) else raise "No valid source defined for cookbook '#{name}'" end end |