Class: Sensu::Mutator
- Inherits:
-
Object
- Object
- Sensu::Mutator
- Includes:
- Mixlib::CLI, Plugin::Utils
- Defined in:
- lib/sensu-mutator.rb
Constant Summary collapse
- @@autorun =
This works just like Plugin::CLI’s autorun.
self
Instance Attribute Summary collapse
-
#argv ⇒ Object
Returns the value of attribute argv.
Class Method Summary collapse
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(argv = ARGV) ⇒ Mutator
constructor
A new instance of Mutator.
- #mutate ⇒ Object
Methods included from Plugin::Utils
#api_request, #api_settings, #api_settings=, #cast_bool_values_int, #config_files, #deep_merge, #event, #event=, #load_config, #map_v2_event_into_v1, #net_http_req_class, #paginated_get, #read_event, #settings
Constructor Details
#initialize(argv = ARGV) ⇒ Mutator
Returns a new instance of Mutator.
44 45 46 47 |
# File 'lib/sensu-mutator.rb', line 44 def initialize(argv = ARGV) super() self.argv = (argv) end |
Instance Attribute Details
#argv ⇒ Object
Returns the value of attribute argv.
42 43 44 |
# File 'lib/sensu-mutator.rb', line 42 def argv @argv end |
Class Method Details
.disable_autorun ⇒ Object
66 67 68 |
# File 'lib/sensu-mutator.rb', line 66 def self.disable_autorun @@autorun = false end |
.method_added(name) ⇒ Object
61 62 63 |
# File 'lib/sensu-mutator.rb', line 61 def method_added(name) @@autorun = self if name == :mutate end |
Instance Method Details
#dump ⇒ Object
54 55 56 |
# File 'lib/sensu-mutator.rb', line 54 def dump puts JSON.dump(@event) end |
#mutate ⇒ Object
49 50 51 52 |
# File 'lib/sensu-mutator.rb', line 49 def mutate ## Override this, be sure any changes are made to @event nil end |