Sha256: 5fbae2f8c494edd6ba2289120348de74165275b6136a549c8d52dff7217b73a0
Contents?: true
Size: 566 Bytes
Versions: 36
Compression:
Stored size: 566 Bytes
Contents
module Billimatic module Resources module Hooks def notify(*hooked_methods) apply_hooks(hooked_methods.flatten) end private def apply_hooks(hooked_methods) hooked_methods.each do |method| alias_method "#{method}_without_notifier", method define_method method do |*args| result = send("#{method}_without_notifier", *args) publish("billimatic.#{base_klass.downcase}.#{method}", result, args.flatten) result end end end end end end
Version data entries
36 entries across 36 versions & 1 rubygems