Class | Chef::Resource

In:

lib/chef/resource/apt_package.rb
lib/chef/resource/bash.rb
lib/chef/resource/breakpoint.rb
lib/chef/resource/cookbook_file.rb
lib/chef/resource/cron.rb
lib/chef/resource/csh.rb
lib/chef/resource/deploy.rb
lib/chef/resource/deploy_revision.rb
lib/chef/resource/directory.rb
lib/chef/resource/dpkg_package.rb
lib/chef/resource/easy_install_package.rb
lib/chef/resource/env.rb
lib/chef/resource/erl_call.rb
lib/chef/resource/execute.rb
lib/chef/resource/file.rb
lib/chef/resource/freebsd_package.rb
lib/chef/resource/gem_package.rb
lib/chef/resource/git.rb
lib/chef/resource/group.rb
lib/chef/resource/http_request.rb
lib/chef/resource/ifconfig.rb
lib/chef/resource/link.rb
lib/chef/resource/log.rb
lib/chef/resource/macports_package.rb
lib/chef/resource/mdadm.rb
lib/chef/resource/mount.rb
lib/chef/resource/ohai.rb
lib/chef/resource/package.rb
lib/chef/resource/pacman_package.rb
lib/chef/resource/perl.rb
lib/chef/resource/portage_package.rb
lib/chef/resource/python.rb
lib/chef/resource/remote_directory.rb
lib/chef/resource/remote_file.rb
lib/chef/resource/route.rb
lib/chef/resource/rpm_package.rb
lib/chef/resource/ruby.rb
lib/chef/resource/ruby_block.rb
lib/chef/resource/scm.rb
lib/chef/resource/script.rb
lib/chef/resource/service.rb
lib/chef/resource/solaris_package.rb
lib/chef/resource/subversion.rb
lib/chef/resource/template.rb
lib/chef/resource/timestamped_deploy.rb
lib/chef/resource/user.rb
lib/chef/resource/yum_package.rb
lib/chef/resource.rb

Parent: | Object

### Methods

action add_notification attribute build_from_file defined_at epic_fail ignore_failure initialize inspect is json_create load_prior_resource method_missing name new node noop not_if notifies notifies_delayed notifies_immediately only_if provider provider_base resolve_notification_references resources run_action subscribes supports to_hash to_json to_s to_text updated= updated? updated_by_last_action updated_by_last_action?

### Included Modules

Chef::Mixin::CheckHelper Chef::Mixin::ParamsValidate Chef::Mixin::Language Chef::Mixin::ConvertToClassName Chef::Mixin::Deprecation Chef::Mixin::ConvertToClassName

### Classes and Modules

Class Chef::Resource::AptPackage
Class Chef::Resource::Bash
Class Chef::Resource::Breakpoint
Class Chef::Resource::CookbookFile
Class Chef::Resource::Cron
Class Chef::Resource::Csh
Class Chef::Resource::Deploy
Class Chef::Resource::DeployBranch
Class Chef::Resource::DeployRevision
Class Chef::Resource::Directory
Class Chef::Resource::DpkgPackage
Class Chef::Resource::EasyInstallPackage
Class Chef::Resource::Env
Class Chef::Resource::ErlCall
Class Chef::Resource::Execute
Class Chef::Resource::File
Class Chef::Resource::FreebsdPackage
Class Chef::Resource::GemPackage
Class Chef::Resource::Git
Class Chef::Resource::Group
Class Chef::Resource::HttpRequest
Class Chef::Resource::Ifconfig
Class Chef::Resource::Link
Class Chef::Resource::Log
Class Chef::Resource::MacportsPackage
Class Chef::Resource::Mdadm
Class Chef::Resource::Mount
Class Chef::Resource::Notification
Class Chef::Resource::Ohai
Class Chef::Resource::Package
Class Chef::Resource::PacmanPackage
Class Chef::Resource::Perl
Class Chef::Resource::PortagePackage
Class Chef::Resource::Python
Class Chef::Resource::RemoteDirectory
Class Chef::Resource::RemoteFile
Class Chef::Resource::Route
Class Chef::Resource::RpmPackage
Class Chef::Resource::Ruby
Class Chef::Resource::RubyBlock
Class Chef::Resource::Scm
Class Chef::Resource::Script
Class Chef::Resource::Service
Class Chef::Resource::SolarisPackage
Class Chef::Resource::Subversion
Class Chef::Resource::Template
Class Chef::Resource::TimestampedDeploy
Class Chef::Resource::User
Class Chef::Resource::YumPackage

### Constants

FORBIDDEN_IVARS | = | [:@run_context, :@node]
HIDDEN_IVARS | = | [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name, :@node]

### Attributes

allowed_actions | [RW] |
cookbook_name | [RW] |
delayed_notifications | [R] |
enclosing_provider | [RW] |
immediate_notifications | [R] | Each notify entry is a resource/action pair, modeled as an Struct with a resource and action member
not_if_args | [R] |
only_if_args | [R] |
params | [RW] |
provider | [RW] |
recipe_name | [RW] |
resource_name | [R] |
run_context | [RW] |
source_line | [RW] |
updated | [R] |

### Public Class methods

attribute(attr_name, validation_opts={})
build_from_file(cookbook_name, filename)
initialize(name, run_context)

default initialize method that ensures that when initialize is finally wrapped (see below), super is called in the event that the resource definer does not implement initialize

json_create(o)
new(name, run_context=nil)
provider_base(arg=nil)

Resources that want providers namespaced somewhere other than Chef::Provider can set the namespace with `provider_base` Ex:

      class MyResource < Chef::Resource
        provider_base Chef::Provider::Deploy
        # ...other stuff
      end

### Public Instance methods

action(arg=nil)
add_notification(action, resources, timing=:delayed)
defined_at()
epic_fail(arg=nil)
ignore_failure(arg=nil)
inspect()
is(*args)
load_prior_resource()
method_missing(method_symbol, *args, &block)

If an unknown method is invoked, determine whether the enclosing Provider‘s lexical scope can fulfill the request. E.g. This happens when the Resource‘s block invokes new_resource.

name(name=nil)
node()
noop(tf=nil)
not_if(arg=nil, args = {}, &blk)
notifies(*args)
notifies_delayed(action, resource_spec)
notifies_immediately(action, resource_spec)
only_if(arg=nil, args = {}, &blk)
provider(arg=nil)
resolve_notification_references()

Iterates over all immediate and delayed notifications, calling resolve_resource_reference on each in turn, causing them to resolve lazy/forward references.

resources(*args)
run_action(action)
subscribes(action, resources, timing=:delayed)
supports(args={})
to_hash()
to_json(*a)

Serialize this object as a hash

to_s()
to_text()
updated=(true_or_false)
updated?()
updated_by_last_action(true_or_false)
updated_by_last_action?()

[Validate]