Module: Comparison::ApplicationHelper

Defined in:
app/helpers/comparison/application_helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#compare(value, other) {|comparison| ... } ⇒ Object

Returns a Presenter for a Comparator for value and other.

If a block is given, the Presenter is yielded to the block.

Yields:

  • (comparison)


9
10
11
12
13
# File 'app/helpers/comparison/application_helper.rb', line 9

def compare(value, other)
  comparison = Presenter.new Comparator.new value, other
  yield comparison if block_given?
  comparison
end