Class: DAF::Action

Inherits:
Object
  • Object
show all
Includes:
Configurable
Defined in:
lib/daf/action.rb

Overview

Stores information related to actions that can be taken as a result of a Monitor firing Exposes only one method, and is a Configurable

Direct Known Subclasses

EmailAction, PushbulletAction, SMSAction, ShellAction

Instance Method Summary collapse

Methods included from Configurable

included

Instance Method Details

#activate(options) { ... } ⇒ Object

Activate this action using given options - takes an optional block parameter that will be invoked when action is complete, with a parameter of if the action was successful and also returns if action was successful

match types expected for each option or will raise an exception

Parameters:

  • options (Hash)

    A hash of options with name/value pairs, must

Yields:

  • If successful, will execute the optional block passed in



18
19
20
21
22
23
# File 'lib/daf/action.rb', line 18

def activate(options)
  process_options(options)
  success = invoke
  yield success if block_given?
  success
end