Class: Benchmark::Memory::Report::Comparison
- Inherits:
-
Object
- Object
- Benchmark::Memory::Report::Comparison
- Defined in:
- lib/benchmark/memory/report/comparison.rb
Overview
Compare entries against each other.
Instance Attribute Summary collapse
-
#entries ⇒ Array<Entry>
readonly
The entries to compare.
Instance Method Summary collapse
-
#initialize(entries) ⇒ Comparison
constructor
Instantiate a new comparison.
-
#possible? ⇒ Boolean
Check if the comparison is possible.
Constructor Details
#initialize(entries) ⇒ Comparison
Instantiate a new comparison.
9 10 11 |
# File 'lib/benchmark/memory/report/comparison.rb', line 9 def initialize(entries) @entries = entries.sort_by(&:measurement) end |
Instance Attribute Details
#entries ⇒ Array<Entry> (readonly)
Returns The entries to compare.
14 15 16 |
# File 'lib/benchmark/memory/report/comparison.rb', line 14 def entries @entries end |
Instance Method Details
#possible? ⇒ Boolean
Check if the comparison is possible
19 20 21 |
# File 'lib/benchmark/memory/report/comparison.rb', line 19 def possible? entries.size > 1 end |