Module: Chef::Mixin::CheckHelper

Included in:
Cookbook::Metadata, Resource
Defined in:
lib/chef/mixin/check_helper.rb

Instance Method Summary collapse

Instance Method Details

#set_if_args(thing, arguments) ⇒ Object

Raises:

  • (ArgumentError)


21
22
23
24
25
26
27
28
# File 'lib/chef/mixin/check_helper.rb', line 21

def set_if_args(thing, arguments)
  raise ArgumentError, "Must call set_if_args with a block!" unless Kernel.block_given?
  if arguments != nil
    yield(arguments)
  else
    thing
  end
end