Sha256: b05570a7d113d383eecee330777882289975ae1ed90e57d63b7aeb5116a7a8d5

Contents?: true

Size: 394 Bytes

Versions: 35

Compression:

Stored size: 394 Bytes

Contents

require 'arc-furnace/unfold'

module ArcFurnace
  class BlockUnfold < Unfold
    private_attr_reader :block

    def initialize(source:, block:)
      raise 'Must specify a block' if block.nil?
      @block = block
      super(source: source)
    end

    def unfold(row)
      if block.arity == 2
        block.call(row, params)
      else
        block.call(row)
      end
    end

  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

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