Module: AhoyCaptain::CompareMode

Included in:
ApplicationController, ComparisonLinkComponent, DashboardPresenter, Stats::ComparableContainerComponent, StickyNavComponent
Defined in:
app/models/concerns/ahoy_captain/compare_mode.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
8
# File 'app/models/concerns/ahoy_captain/compare_mode.rb', line 3

def self.included(klass)
  if klass < ActionController::Base
    klass.helper_method :compare_mode?
    klass.helper_method :comparison_label
  end
end

Instance Method Details

#compare_mode?Boolean

doesn’t work for realtime and realtime doesn’t need a secondary range

Returns:

  • (Boolean)


11
12
13
# File 'app/models/concerns/ahoy_captain/compare_mode.rb', line 11

def compare_mode?
  comparison_mode.enabled?
end

#comparison_modeObject



15
16
17
# File 'app/models/concerns/ahoy_captain/compare_mode.rb', line 15

def comparison_mode
  @comparison_mode ||= ComparisonMode.new(params)
end