Method: Chef::Resource#only_if

Defined in:
lib/chef/resource.rb

#only_if(arg = nil, args = {}, &blk) ⇒ Object



355
356
357
358
359
360
361
362
363
364
# File 'lib/chef/resource.rb', line 355

def only_if(arg=nil, args = {}, &blk)
  if Kernel.block_given?
    @only_if = blk
    @only_if_args = args
  else
    @only_if = arg if arg
    @only_if_args = args if arg
  end
  @only_if
end