class Ravengar::SourceWrapper

Public Class Methods

new(source) click to toggle source
# File lib/ravengar/engine/source_wrapper.rb, line 6
def initialize(source)
  @source = source
  @head_lambda = ->(it) { it }
end

Public Instance Methods

call() click to toggle source
# File lib/ravengar/engine/source_wrapper.rb, line 16
def call
  run
end
each() { |call| ... } click to toggle source
# File lib/ravengar/engine/source_wrapper.rb, line 20
def each
  catch :abort_proc do
    @source.each do |it|
      catch :skip_proc do
        yield @head_lambda.call(it)
      end
    end
  end
ensure
  @source.close if @source.respond_to?(:close)
end
|(lambd) click to toggle source
# File lib/ravengar/engine/source_wrapper.rb, line 11
def |(lambd)
  @head_lambda = @head_lambda | lambd
  self
end