Class: JIJI::Dao::CSVIterator
- Defined in:
- lib/jiji/dao/timed_data_dao.rb
Overview
CSVReaderをIteratorにする。
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(reader) ⇒ CSVIterator
constructor
A new instance of CSVIterator.
- #next ⇒ Object
- #next? ⇒ Boolean
Methods inherited from Iterator
Constructor Details
#initialize(reader) ⇒ CSVIterator
Returns a new instance of CSVIterator.
175 176 177 178 179 |
# File 'lib/jiji/dao/timed_data_dao.rb', line 175 def initialize( reader ) super() @reader = reader @item = @reader.shift end |
Instance Method Details
#close ⇒ Object
190 191 192 |
# File 'lib/jiji/dao/timed_data_dao.rb', line 190 def close @reader.close end |
#next ⇒ Object
183 184 185 186 187 188 189 |
# File 'lib/jiji/dao/timed_data_dao.rb', line 183 def next begin @item ensure @item = @reader.shift end end |
#next? ⇒ Boolean
180 181 182 |
# File 'lib/jiji/dao/timed_data_dao.rb', line 180 def next? !@item.empty? end |