module Sequel::Plugins::HookClassMethods::ClassMethods

Public Instance Methods

freeze() click to toggle source

Freeze hooks when freezing model class.

Calls superclass method
   # File lib/sequel/plugins/hook_class_methods.rb
50 def freeze
51   @hooks.freeze.each_value(&:freeze)
52   super
53 end
has_hooks?(hook) click to toggle source

Returns true if there are any hook blocks for the given hook.

   # File lib/sequel/plugins/hook_class_methods.rb
56 def has_hooks?(hook)
57   !@hooks[hook].empty?
58 end
hook_blocks(hook) { |v| ... } click to toggle source

Yield every block related to the given hook.

   # File lib/sequel/plugins/hook_class_methods.rb
61 def hook_blocks(hook)
62   # SEQUEL6: Remove
63   Sequel::Deprecation.deprecate("The hook_blocks class method in the hook_class_methods plugin is deprecated and will be removed in Sequel 6.")
64   @hooks[hook].each{|_,v,_| yield v}
65 end
hook_methods_for(hook) { |m| ... } click to toggle source

Yield every method related to the given hook.

   # File lib/sequel/plugins/hook_class_methods.rb
68 def hook_methods_for(hook)
69   @hooks[hook].each{|_,_,m| yield m}
70 end