Method: PoolParty::Resource#notifies

Defined in:
lib/poolparty/resource.rb

#notifies(other_resources_hash, action_to_take = :reload) ⇒ Object

META FUNCTIONS ALL RESOURCES HAVE THESE METHODS AVAILABLE



43
44
45
46
47
48
49
50
51
# File 'lib/poolparty/resource.rb', line 43

def notifies(other_resources_hash, action_to_take=:reload)
  @meta_notifies ||= {}
  other_resources_hash.each do |k,v|
    notifies_array = (@meta_notifies[k] ||= [])
    notifies_array << [v, action_to_take] unless notifies_array.include?([v, action_to_take])
    # Implicitly add a require
    # requires(k => v)
  end
end