Sha256: 75603c5a0089eccf5b49c13c87d642f05d5b071b42f22b141e34c35d20c29c9f

Contents?: true

Size: 633 Bytes

Versions: 28

Compression:

Stored size: 633 Bytes

Contents

require 'arc-furnace/source'

# Observe all values in an input stream. All values are passed down
# to the next node un-adultered.
module ArcFurnace
  class Observer < Source
    private_attr_reader :source

    def initialize(source:)
      @source = source
    end

    def value
      value = source.value.deep_dup
      observe(value) if value
      value
    end

    delegate [:empty?, :advance] => :source

    # Observes each row in the node's input stream. This node should not
    # modify the row passed.
    #
    # This method's return value is ignored
    def observe(row)
      raise "Unimplemented"
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
arc-furnace-0.1.42 lib/arc-furnace/observer.rb
arc-furnace-0.1.41 lib/arc-furnace/observer.rb
arc-furnace-0.1.40 lib/arc-furnace/observer.rb
arc-furnace-0.1.39 lib/arc-furnace/observer.rb
arc-furnace-0.1.38 lib/arc-furnace/observer.rb
arc-furnace-0.1.37 lib/arc-furnace/observer.rb
arc-furnace-0.1.36 lib/arc-furnace/observer.rb
arc-furnace-0.1.35 lib/arc-furnace/observer.rb
arc-furnace-0.1.34 lib/arc-furnace/observer.rb
arc-furnace-0.1.33 lib/arc-furnace/observer.rb
arc-furnace-0.1.32 lib/arc-furnace/observer.rb
arc-furnace-0.1.31 lib/arc-furnace/observer.rb
arc-furnace-0.1.30 lib/arc-furnace/observer.rb
arc-furnace-0.1.29 lib/arc-furnace/observer.rb
arc-furnace-0.1.28 lib/arc-furnace/observer.rb
arc-furnace-0.1.27 lib/arc-furnace/observer.rb
arc-furnace-0.1.26 lib/arc-furnace/observer.rb
arc-furnace-0.1.25 lib/arc-furnace/observer.rb
arc-furnace-0.1.24 lib/arc-furnace/observer.rb
arc-furnace-0.1.23 lib/arc-furnace/observer.rb