Class: Viiite::BDB::Cached::Proxy
- Inherits:
-
Viiite::Benchmark
- Object
- Viiite::Benchmark
- Viiite::BDB::Cached::Proxy
- Includes:
- Alf::Iterator
- Defined in:
- lib/viiite/bdb/cached.rb
Instance Attribute Summary
Attributes inherited from Viiite::Benchmark
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(benchmark, cache_file, cache_mode) ⇒ Proxy
constructor
A new instance of Proxy.
Methods inherited from Viiite::Benchmark
Methods included from Viiite::Benchmark::Runner
#range_over, #report, #variation_point, #with
Constructor Details
#initialize(benchmark, cache_file, cache_mode) ⇒ Proxy
Returns a new instance of Proxy.
42 43 44 45 46 47 |
# File 'lib/viiite/bdb/cached.rb', line 42 def initialize(benchmark, cache_file, cache_mode) @benchmark = benchmark @cache_file = cache_file @cache_mode = cache_mode super(@benchmark) end |
Instance Method Details
#each ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/viiite/bdb/cached.rb', line 49 def each FileUtils.mkdir_p(File.dirname(@cache_file)) File.open(@cache_file, @cache_mode) do |io| @benchmark.each do |tuple| io << Alf::Tools.to_ruby_literal(tuple) << "\n" yield(tuple) end end end |