Class: OpsviewRest::NotificationMethod
- Inherits:
-
Object
- Object
- OpsviewRest::NotificationMethod
- Includes:
- Mixin
- Defined in:
- lib/opsview_rest/notificationmethod.rb
Instance Attribute Summary collapse
-
#opsview ⇒ Object
Returns the value of attribute opsview.
-
#options ⇒ Object
Returns the value of attribute options.
-
#resource_type ⇒ Object
Returns the value of attribute resource_type.
Instance Method Summary collapse
-
#initialize(opsview, options = {}) ⇒ NotificationMethod
constructor
A new instance of NotificationMethod.
Methods included from Mixin
#resource_path, #save, #to_json
Constructor Details
#initialize(opsview, options = {}) ⇒ NotificationMethod
Returns a new instance of NotificationMethod.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/opsview_rest/notificationmethod.rb', line 9 def initialize(opsview, = {}) @options = { name: 'Unknown', master: false, active: true, command: 'notify_by_email', contact_variables: 'EMAIL', save: true, replace: false }.update @opsview = opsview @resource_type = @options[:type] @options[:master] = (@options[:master] ? 1 : 0) @options[:active] = (@options[:active] ? 1 : 0) save(@options[:replace]) if @options[:save] end |
Instance Attribute Details
#opsview ⇒ Object
Returns the value of attribute opsview.
7 8 9 |
# File 'lib/opsview_rest/notificationmethod.rb', line 7 def opsview @opsview end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/opsview_rest/notificationmethod.rb', line 7 def @options end |
#resource_type ⇒ Object
Returns the value of attribute resource_type.
7 8 9 |
# File 'lib/opsview_rest/notificationmethod.rb', line 7 def resource_type @resource_type end |