module Garcon::Resource::Blender

Combine a resource and provider class for quick and easy oven baked goodness. Never has cooking been this fun since the invention of the grocery store!

@example

class Chef::Resource::HouseKeeping < Chef::Resource
  include Garcon(blender: true)

  attribute :path,
    kind_of: String,
    name_attribute: true
  attribute :message,
    kind_of: String,
    default: 'Clean the kitchen'

  action :run do
    file new_resource.path do
      content new_resource.message
    end
  end
end

Public Instance Methods

is_a?(klass) click to toggle source

Coerce is_a? so that the DSL will consider this a Provider for the purposes of attaching enclosing_provider.

@param klass [Class]

@return [Boolean]

@api private

Calls superclass method
# File lib/garcon/chef/resource/blender.rb, line 55
def is_a?(klass)
  klass == Chef::Provider ? true : super
end
provider_for_action(action) click to toggle source

Coerce provider_for_action so that the resource is also the provider.

@param action [Symbol]

@return [Chef::Provider]

@api private

Calls superclass method
# File lib/garcon/chef/resource/blender.rb, line 66
def provider_for_action(action)
  provider(self.class.blender_provider_class) unless provider
  super
end