Class: JIJI::PushBackReader
- Inherits:
-
Object
- Object
- JIJI::PushBackReader
- Defined in:
- lib/jiji/util/rate_data_importer.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(reader) ⇒ PushBackReader
constructor
A new instance of PushBackReader.
- #shift ⇒ Object
- #unshift(v) ⇒ Object
Constructor Details
#initialize(reader) ⇒ PushBackReader
Returns a new instance of PushBackReader.
190 191 192 193 |
# File 'lib/jiji/util/rate_data_importer.rb', line 190 def initialize( reader ) @reader = reader @buff = [] end |
Instance Method Details
#close ⇒ Object
200 201 202 |
# File 'lib/jiji/util/rate_data_importer.rb', line 200 def close @reader.close end |
#shift ⇒ Object
194 195 196 |
# File 'lib/jiji/util/rate_data_importer.rb', line 194 def shift @buff.empty? ? @reader.shift : @buff.shift end |
#unshift(v) ⇒ Object
197 198 199 |
# File 'lib/jiji/util/rate_data_importer.rb', line 197 def unshift(v) @buff.unshift v end |