Sha256: aad20dad7148789a9333e1e1bfd2dafa540de179a3143887379ca5a3b8c744b4

Contents?: true

Size: 222 Bytes

Versions: 5

Compression:

Stored size: 222 Bytes

Contents

module Stateful #:nodoc:
  module Listeners #:nodoc:
    def listeners
      @listeners ||= Hash.new { |h,k| h[k] = [] }
    end
    
    def fire(kind, *args)
      listeners[kind].each { |l| l[*args] }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jbarnette-stateful-1.0.0.200807042242 lib/stateful/listeners.rb
jbarnette-stateful-1.0.0.200807052303 lib/stateful/listeners.rb
jbarnette-stateful-1.0.0.200807060249 lib/stateful/listeners.rb
jbarnette-stateful-1.0.0.200807092012 lib/stateful/listeners.rb
jbarnette-stateful-1.0.0.200812261315 lib/stateful/listeners.rb