Class: Hawkular::Alerts::Trigger::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/hawkular/alerts/alerts_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_hash) ⇒ Action

Returns a new instance of Action



519
520
521
522
523
524
525
526
# File 'lib/hawkular/alerts/alerts_api.rb', line 519

def initialize(action_hash)
  return if action_hash.nil?

  @action_plugin = action_hash['actionPlugin']
  @action_id = action_hash['actionId']
  @tenant_id = action_hash['tenantId']
  @states = action_hash['states']
end

Instance Attribute Details

#action_idObject

Returns the value of attribute action_id



517
518
519
# File 'lib/hawkular/alerts/alerts_api.rb', line 517

def action_id
  @action_id
end

#action_pluginObject

Returns the value of attribute action_plugin



517
518
519
# File 'lib/hawkular/alerts/alerts_api.rb', line 517

def action_plugin
  @action_plugin
end

#statesObject

Returns the value of attribute states



517
518
519
# File 'lib/hawkular/alerts/alerts_api.rb', line 517

def states
  @states
end

#tenant_idObject

Returns the value of attribute tenant_id



517
518
519
# File 'lib/hawkular/alerts/alerts_api.rb', line 517

def tenant_id
  @tenant_id
end

Instance Method Details

#to_hObject



528
529
530
531
532
533
534
535
# File 'lib/hawkular/alerts/alerts_api.rb', line 528

def to_h
  action_hash = {}
  action_hash['actionPlugin'] = @action_plugin
  action_hash['actionId'] = @action_id
  action_hash['tenantId'] = @tenant_id
  action_hash['states'] = @states
  action_hash
end