Sha256: 0cb9c3a4538fd4926873c433c91d0fda9392811e663632b4670e2ee67dc1255c

Contents?: true

Size: 454 Bytes

Versions: 2

Compression:

Stored size: 454 Bytes

Contents

module Wukong
  class Emitter < Hanuman::DirectedLink
    
    def initialize(from, into)
      @from = from
      @into = into
      @from.write_attribute(:emitter, self)
    end
    
    def call(record)
      into.process(record)
    end

    def to_s
      "#<#{self.class}(#{from.label} -> #{into.label})>"
    end

  end
  
  Hanuman::LinkFactory.register(:emitter, ->(from_stage, into_stage){ Wukong::Emitter.new(from_stage, into_stage) })
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wukong-3.0.0.pre3 lib/wukong/emitter.rb
wukong-3.0.0.pre2 lib/wukong/emitter.rb