Sha256: da7a1b78f83aad313e1914ef9c9ccfd197031e2832e1c1a68ce28e310143d194

Contents?: true

Size: 389 Bytes

Versions: 1

Compression:

Stored size: 389 Bytes

Contents

module Populus
  module Watch
    class Node
      def initialize
        @on_receive_hooks = []
      end

      def on_receive(&b)
        @on_receive_hooks << b
      end

      def accept(json)
        @on_receive_hooks.each do |hook|
          begin
            hook.call(json)
          rescue => e
            puts e, "Ignore."
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
populus-0.0.1.pre3 lib/populus/watch/node.rb