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, #root
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, #full_path, #include?, load_file, parse, #parse, #write
Constructor Details
#initialize(scanner) ⇒ SparseRecordSet
Returns a new instance of SparseRecordSet.
269 270 271 272 273 |
# File 'lib/fingerprint/record.rb', line 269 def initialize(scanner) super() @scanner = scanner end |
Instance Method Details
#lookup(path) ⇒ Object
275 276 277 278 279 280 281 |
# File 'lib/fingerprint/record.rb', line 275 def lookup(path) if @paths.key?(path) return @paths[path] else @paths[path] = @scanner.scan_path(path) end end |