Class: Viiite::Benchmark
- Inherits:
-
Object
- Object
- Viiite::Benchmark
- Includes:
- Alf::Iterator, Runner
- Defined in:
- lib/viiite/benchmark.rb,
lib/viiite/benchmark/runner.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Runner
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Class Method Summary collapse
Instance Method Summary collapse
- #each(&reporter) ⇒ Object
-
#initialize(definition) ⇒ Benchmark
constructor
A new instance of Benchmark.
Methods included from Runner
#range_over, #report, #variation_point, #with
Constructor Details
#initialize(definition) ⇒ Benchmark
Returns a new instance of Benchmark.
9 10 11 |
# File 'lib/viiite/benchmark.rb', line 9 def initialize(definition) @definition = definition end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
7 8 9 |
# File 'lib/viiite/benchmark.rb', line 7 def definition @definition end |
Class Method Details
.new(arg, *others) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/viiite/benchmark.rb', line 14 def self.new(arg, *others) case arg when String load File.(arg) @benchmarks.pop when IO, StringIO Kernel.eval(arg.read, TOPLEVEL_BINDING) @benchmarks.pop else bench = super(arg) @benchmarks << bench bench end end |
Instance Method Details
#each(&reporter) ⇒ Object
29 30 31 |
# File 'lib/viiite/benchmark.rb', line 29 def each(&reporter) self.dup._each(&reporter) end |