Method: Ru::Stream#map

Defined in:
lib/ru/stream.rb

#map(method = nil, *args, &block) ⇒ Object



72
73
74
75
76
77
78
79
80
# File 'lib/ru/stream.rb', line 72

def map(method=nil, *args, &block)
  if method.nil? && !block_given?
    each_line
  elsif method.nil?
    self.class.new @stream.map(&block)
  else
    self.class.new @stream.map { |item| item.send(method, *args) }
  end
end