Class: Benchmark::Memory::Report::Comparison

Inherits:
Object
  • Object
show all
Defined in:
lib/benchmark/memory/report/comparison.rb

Overview

Compare entries against each other.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entries) ⇒ Comparison

Instantiate a new comparison.

Parameters:

  • entries (Array<Entry>)

    The entries to compare.



9
10
11
# File 'lib/benchmark/memory/report/comparison.rb', line 9

def initialize(entries)
  @entries = entries.sort_by(&:measurement)
end

Instance Attribute Details

#entriesArray<Entry> (readonly)

Returns The entries to compare.

Returns:

  • (Array<Entry>)

    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

Returns:

  • (Boolean)


19
20
21
# File 'lib/benchmark/memory/report/comparison.rb', line 19

def possible?
  entries.size > 1
end