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.22 lib/arc-furnace/observer.rb
arc-furnace-0.1.21 lib/arc-furnace/observer.rb
arc-furnace-0.1.20 lib/arc-furnace/observer.rb
arc-furnace-0.1.19 lib/arc-furnace/observer.rb
arc-furnace-0.1.18 lib/arc-furnace/observer.rb
arc-furnace-0.1.16 lib/arc-furnace/observer.rb
arc-furnace-0.1.15 lib/arc-furnace/observer.rb
arc-furnace-0.1.14 lib/arc-furnace/observer.rb