Class: Tb::CSVReader

Inherits:
Object
  • Object
show all
Defined in:
lib/tb/csv.rb

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ CSVReader

Returns a new instance of CSVReader.


66
67
68
# File 'lib/tb/csv.rb', line 66

def initialize(input)
  @csv = CSV.new(input)
end

Instance Method Details

#eachObject


74
75
76
77
78
79
# File 'lib/tb/csv.rb', line 74

def each
  while ary = self.shift
    yield ary
  end
  nil
end

#shiftObject


70
71
72
# File 'lib/tb/csv.rb', line 70

def shift
  @csv.shift
end