Module: Nquery::HomeHelper

Defined in:
app/helpers/nquery/home_helper.rb

Instance Method Summary collapse

Instance Method Details

#chart_type_label(chart) ⇒ Object



19
20
21
# File 'app/helpers/nquery/home_helper.rb', line 19

def chart_type_label(chart)
  chart.chart_type.titleize
end

#home_greetingObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/helpers/nquery/home_helper.rb', line 5

def home_greeting
  hour = Time.zone.now.hour
  salutation = if hour < 12
                 "Good morning"
               elsif hour < 18
                 "Good afternoon"
               else
                 "Good evening"
               end

  name = current_nquery_user&.first_name.presence || "there"
  "#{salutation}, #{name}"
end