class CooCoo::Transformers::Base

Public Class Methods

bin_op(*ops) click to toggle source
# File lib/coo-coo/transformer.rb, line 20
def self.bin_op(*ops)
  ops.each do |op|
    bin_op_inner(op)
  end
end
bin_op_inner(op) click to toggle source
# File lib/coo-coo/transformer.rb, line 26
def self.bin_op_inner(op)
  define_method(op) do |other|
    Combo.new(self, other) do |a, b|
      a.send(op, b)
    end
  end
end

Public Instance Methods

drop(n) click to toggle source
# File lib/coo-coo/transformer.rb, line 6
def drop(n)
  n.times do
    self.next
  end
  
  self
rescue StopIteration
  self
end
first(n) click to toggle source
# File lib/coo-coo/transformer.rb, line 16
def first(n)
  Stopper.new(self, n)
end