Method: ChefAPI::Resource::Base.build

Defined in:
lib/chef-api/resources/base.rb

.build(attributes = {}, prefix = {}) ⇒ Object

Build a new resource from the given attributes.

Examples:

build an empty resource

Bacon.build #=> #<ChefAPI::Resource::Bacon>

build a resource with attributes

Bacon.build(foo: 'bar') #=> #<ChefAPI::Resource::Baocn foo: bar>

Parameters:

  • attributes (Hash) (defaults to: {})

    the list of attributes for the new resource - any attributes that are not defined in the schema are silently ignored

See Also:



275
276
277
# File 'lib/chef-api/resources/base.rb', line 275

def build(attributes = {}, prefix = {})
  new(attributes, prefix)
end