Class Index [+]

Quicksearch

Sequel::Plugins::InstanceHooks::InstanceMethods

Constants

BEFORE_HOOKS
AFTER_HOOKS
HOOKS

Private Instance Methods

add_instance_hook(hook, &block) click to toggle source

Add the block as an instance level hook. For before hooks, add it to the beginning of the instance hook’s array. For after hooks, add it to the end.

    # File lib/sequel/plugins/instance_hooks.rb, line 49
49:         def add_instance_hook(hook, &block)
50:           instance_hooks(hook).send(BEFORE_HOOKS.include?(hook) ? :unshift : :push, block)
51:         end
instance_hooks(hook) click to toggle source

An array of instance level hook blocks for the given hook type.

    # File lib/sequel/plugins/instance_hooks.rb, line 54
54:         def instance_hooks(hook)
55:           @instance_hooks ||= {}
56:           @instance_hooks[hook] ||= []
57:         end
run_after_instance_hooks(hook) click to toggle source

Run all hook blocks of the given hook type.

    # File lib/sequel/plugins/instance_hooks.rb, line 60
60:         def run_after_instance_hooks(hook)
61:           instance_hooks(hook).each{|b| b.call}
62:         end
run_before_instance_hooks(hook) click to toggle source

Run all hook blocks of the given hook type. If a hook block returns false, immediately return false without running the remaining blocks.

    # File lib/sequel/plugins/instance_hooks.rb, line 66
66:         def run_before_instance_hooks(hook)
67:           instance_hooks(hook).each{|b| return false if b.call == false}
68:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.