Class: Blooper::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/blooper/input.rb

Instance Method Summary collapse

Constructor Details

#initialize(input = STDIN) ⇒ Input

Returns a new instance of Input.



4
5
6
# File 'lib/blooper/input.rb', line 4

def initialize(input = STDIN)
  @input = input
end

Instance Method Details

#eachObject



8
9
10
11
12
13
# File 'lib/blooper/input.rb', line 8

def each
  @input.each do |line|
    line = Line.new(line)
    yield Rows.new(line.clean) if line.valid?
  end
end