Method: Puppet::Interface::ActionBuilder#when_invoked

Defined in:
lib/puppet/interface/action_builder.rb

#when_invoked({|options| ... }) ⇒ void #when_invoked({|arg1, arg2, options| ... }) ⇒ void

This method returns an undefined value.

Sets what the action does when it is invoked. This takes a block which will be called when the action is invoked. The action will accept arguments based on the arity of the block. It should always take at least one argument for options. Options will be the last argument.

Overloads:

  • #when_invoked({|options| ... }) ⇒ void

    An action with no arguments

  • #when_invoked({|arg1, arg2, options| ... }) ⇒ void

    An action with two arguments



50
51
52
# File 'lib/puppet/interface/action_builder.rb', line 50

def when_invoked(&block)
  @action.when_invoked = block
end