Class: Chef::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/sugar/node.rb

Instance Method Summary collapse

Instance Method Details

#in?(environment) ⇒ Boolean

Determine if the current node is in the given Chef environment (or matches the given regular expression).

Parameters:

  • environment (String, Regex)

Returns:

  • (Boolean)


27
28
29
# File 'lib/chef/sugar/node.rb', line 27

def in?(environment)
  environment === chef_environment
end

#includes_recipe?(recipe_name) ⇒ Boolean Also known as: include_recipe?

Determine if the current node includes the given recipe name.

Parameters:

  • recipe_name (String)

Returns:

  • (Boolean)


36
37
38
# File 'lib/chef/sugar/node.rb', line 36

def includes_recipe?(recipe_name)
  run_list.include?(recipe_name)
end