Class: Bud::BudFileReader
- Inherits:
-
BudReadOnly
- Object
- BudCollection
- BudReadOnly
- Bud::BudFileReader
- Defined in:
- lib/bud/collections.rb
Overview
:nodoc: all
Instance Attribute Summary
Attributes inherited from BudCollection
#accumulate_tick_deltas, #bud_instance, #cols, #delta, #invalidated, #is_source, #key_cols, #new_delta, #pending, #rescan, #scanner_cnt, #storage, #struct, #tabname, #tick_delta, #wired_by
Instance Method Summary (collapse)
- - (Object) each(&blk)
-
- (Object) each_raw(&block)
:nodoc: all.
-
- (BudFileReader) initialize(name, filename, bud_instance)
constructor
:nodoc: all.
- - (Object) tick
Methods inherited from BudReadOnly
#invalidate_at_tick, #invalidate_cache, #merge
Methods inherited from BudCollection
#*, #<<, #<=, #[], #add_rescan_invalidate, #argagg, #argmax, #argmin, #bootstrap, #canonicalize_col, #close, #do_insert, #each_from_sym, #each_tick_delta, #each_with_index, #empty?, #exists?, #flat_map, #flush, #flush_deltas, #group, #has_key?, #include?, #init_schema, #insert, #inspect, #inspected, #invalidate_at_tick, #keys, #length, #merge, #non_temporal_predecessors, #notin, #null_tuple, #pending_merge, #positive_predecessors, #prep_aggpairs, #pro, #qualified_tabname, #reduce, #register_coll_expr, #rename, #schema, #sort, #tick_deltas, #tick_metrics, #to_push_elem, #uniquify_tabname, #val_cols, #values
Methods included from Enumerable
Constructor Details
- (BudFileReader) initialize(name, filename, bud_instance)
:nodoc: all
1396 1397 1398 1399 1400 1401 1402 1403 1404 |
# File 'lib/bud/collections.rb', line 1396 def initialize(name, filename, bud_instance) # :nodoc: all super(name, bud_instance, {[:lineno] => [:text]}) @filename = filename @storage = {} # NEEDS A TRY/RESCUE BLOCK @fd = File.open(@filename, "r") @linenum = 0 @invalidated = true end |
Instance Method Details
- (Object) each(&blk)
1421 1422 1423 |
# File 'lib/bud/collections.rb', line 1421 def each(&blk) each_raw(&blk) end |
- (Object) each_raw(&block)
:nodoc: all
1411 1412 1413 1414 1415 1416 1417 1418 |
# File 'lib/bud/collections.rb', line 1411 def each_raw(&block) # :nodoc: all while (l = @fd.gets) t = [@linenum, l.strip] @linenum += 1 tick_metrics if bud_instance.[:metrics] yield t end end |
- (Object) tick
1406 1407 1408 |
# File 'lib/bud/collections.rb', line 1406 def tick @invalidated = true end |