class SousChef::NodeBuilder

Public Class Methods

new(name, collection_hash) click to toggle source
# File lib/sous-chef/node_builder.rb, line 4
def initialize(name, collection_hash)
  @name = name
  @collection_hash = collection_hash
end

Public Instance Methods

build() click to toggle source
# 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

Private Instance Methods

build_nodes() click to toggle source
# File lib/sous-chef/node_builder.rb, line 19
def build_nodes
  nodes = SousChef::Collection.new(@name)
  @collection_hash.each do |name, collection_hash|
    nodes[name] = SousChef::NodeBuilder.new(name, collection_hash).build
  end
  nodes
end