Class: Easybench::Benchmark
- Inherits:
-
Object
- Object
- Easybench::Benchmark
- Defined in:
- lib/easybench.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Instance Method Summary collapse
-
#initialize(name, options = {}, &tests) ⇒ Benchmark
constructor
A new instance of Benchmark.
- #iterations ⇒ Object
- #name(indent = nil) ⇒ Object
Constructor Details
#initialize(name, options = {}, &tests) ⇒ Benchmark
Returns a new instance of Benchmark.
25 26 27 28 29 |
# File 'lib/easybench.rb', line 25 def initialize(name, = {}, &tests) @name = name @options = @tests = tests end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
22 23 24 |
# File 'lib/easybench.rb', line 22 def @options end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
23 24 25 |
# File 'lib/easybench.rb', line 23 def tests @tests end |
Instance Method Details
#iterations ⇒ Object
35 36 37 |
# File 'lib/easybench.rb', line 35 def iterations @options[:iterations] end |
#name(indent = nil) ⇒ Object
31 32 33 |
# File 'lib/easybench.rb', line 31 def name(indent = nil) indent ? @name.rjust(indent) : @name end |