Class: SousChef::NodeBuilder

Inherits:
Object
  • Object
show all
Includes:
NodeHelpers
Defined in:
lib/sous-chef/node_builder.rb

Instance Method Summary collapse

Methods included from NodeHelpers

node?

Constructor Details

#initialize(name, collection_hash) ⇒ NodeBuilder

Returns a new instance of NodeBuilder.



4
5
6
7
# File 'lib/sous-chef/node_builder.rb', line 4

def initialize(name, collection_hash)
  @name = name
  @collection_hash = collection_hash
end

Instance Method Details

#buildObject



9
10
11
12
13
14
15
# File 'lib/sous-chef/node_builder.rb', line 9

def build
  if node?(@collection_hash)
    SousChef::Node.new(@name, @collection_hash)
  else
    build_nodes
  end
end