Class: ObjectsFramework::Hooks

Inherits:
Object
  • Object
show all
Defined in:
lib/objectsframework/hooks.rb

Class Method Summary collapse

Class Method Details

.fire(filter, klass) ⇒ Object



3
4
5
6
7
8
# File 'lib/objectsframework/hooks.rb', line 3

def self.fire(filter, klass)
	hooks_to_execute = klass.class.get_hooks.select { |hook| hook[:filter] == filter }
	hooks_to_execute.each do |hook|
		klass.send(hook[:method].to_sym)
	end
end