Class: Fingerprint::SparseRecordSet
- Defined in:
- lib/fingerprint/record.rb
Overview
This record set dynamically computes data from the disk as required.
Instance Attribute Summary
Attributes inherited from RecordSet
#configuration, #keys, #paths, #records
Instance Method Summary collapse
-
#initialize(scanner) ⇒ SparseRecordSet
constructor
A new instance of SparseRecordSet.
- #lookup(path) ⇒ Object
Methods inherited from RecordSet
#<<, #compare, #empty?, #find, #find_by_key, #include?, load, load_file, parse, #parse, #write
Constructor Details
#initialize(scanner) ⇒ SparseRecordSet
Returns a new instance of SparseRecordSet.
249 250 251 252 253 |
# File 'lib/fingerprint/record.rb', line 249 def initialize(scanner) super() @scanner = scanner end |
Instance Method Details
#lookup(path) ⇒ Object
255 256 257 258 259 260 261 |
# File 'lib/fingerprint/record.rb', line 255 def lookup(path) if @paths.key?(path) return @paths[path] else @paths[path] = @scanner.scan_path(path) end end |