Method: Chef::Resource.resource_name

Defined in:
lib/chef/resource.rb

.resource_name(name = NOT_PASSED) ⇒ Symbol

The display name of this resource type, for printing purposes.

Call ‘resource_name nil` to remove the resource name

Parameters:

  • value (Symbol)

    The desired name of this resource type (e.g. execute), or nil if this class is abstract and has no resource_name.

Returns:

  • (Symbol)

    The name of this resource type (e.g. :execute).



971
972
973
974
975
976
977
978
979
# File 'lib/chef/resource.rb', line 971

def self.resource_name(name = NOT_PASSED)
  # Setter
  if name != NOT_PASSED
    @resource_name = name.to_sym rescue nil
  end

  @resource_name = nil unless defined?(@resource_name)
  @resource_name
end