Sha256: 2fffef3ee564da7bf4948ed449f4318a1867be2072813506cb683511d05f981a
Contents?: true
Size: 350 Bytes
Versions: 109
Compression:
Stored size: 350 Bytes
Contents
module Pageflow class Hooks def initialize @subscribers = Hash.new do |hash, key| hash[key] = [] end end def on(event, subscriber) @subscribers[event] << subscriber end def invoke(event, *args) @subscribers[event].each do |subscriber| subscriber.call(*args) end end end end
Version data entries
109 entries across 109 versions & 1 rubygems