class ObjectsFramework::Hooks

Public Class Methods

continue() click to toggle source
# File lib/objectsframework/hooks.rb, line 16
            def self.continue
  return 0
end
fire(filter, klass) click to toggle source
# 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|
                result = klass.send(hook[:method].to_sym)
                return result unless result == 0
        end
        return 0
end
hook_exists?(filter,klass) click to toggle source
# File lib/objectsframework/hooks.rb, line 12
def self.hook_exists?(filter,klass)
        !(klass.class.get_hooks.select{|hook| hook[:filter] == filter}).empty?
end