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