Class: Itamae::Notification

Inherits:
Struct
  • Object
show all
Defined in:
lib/itamae/notification.rb

Direct Known Subclasses

Subscription

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action


4
5
6
# File 'lib/itamae/notification.rb', line 4

def action
  @action
end

#defined_in_resourceObject

Returns the value of attribute defined_in_resource


4
5
6
# File 'lib/itamae/notification.rb', line 4

def defined_in_resource
  @defined_in_resource
end

#target_resource_descObject

Returns the value of attribute target_resource_desc


4
5
6
# File 'lib/itamae/notification.rb', line 4

def target_resource_desc
  @target_resource_desc
end

#timingObject

Returns the value of attribute timing


4
5
6
# File 'lib/itamae/notification.rb', line 4

def timing
  @timing
end

Instance Method Details

#action_resourceObject


13
14
15
# File 'lib/itamae/notification.rb', line 13

def action_resource
  resource
end

#resourceObject


5
6
7
# File 'lib/itamae/notification.rb', line 5

def resource
  runner.children.find_resource_by_description(target_resource_desc)
end

#run(options) ⇒ Object


9
10
11
# File 'lib/itamae/notification.rb', line 9

def run(options)
  action_resource.run(action, options)
end

#runnerObject


17
18
19
# File 'lib/itamae/notification.rb', line 17

def runner
  defined_in_resource.recipe.runner
end