Public Instance methods
freeze()
Freeze hooks when freezing model class.
[show source]
# File lib/sequel/plugins/hook_class_methods.rb 50 def freeze 51 @hooks.freeze.each_value(&:freeze) 52 super 53 end
has_hooks?(hook)
Returns true if there are any hook blocks for the given hook.
[show source]
# File lib/sequel/plugins/hook_class_methods.rb 56 def has_hooks?(hook) 57 !@hooks[hook].empty? 58 end
hook_blocks(hook)
Yield every block related to the given hook.
[show source]
# 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)
Yield every method related to the given hook.
[show source]
# File lib/sequel/plugins/hook_class_methods.rb 68 def hook_methods_for(hook) 69 @hooks[hook].each{|_,_,m| yield m} 70 end