Module: StatsHelper

Defined in:
app/helpers/stats_helper.rb

Instance Method Summary collapse

Instance Method Details

#array_of_month_and_year_labels(count) ⇒ Object



10
11
12
# File 'app/helpers/stats_helper.rb', line 10

def array_of_month_and_year_labels(count)
  Array.new(count) { |i| month_and_year_label(i) }
end

#array_of_month_labels(count) ⇒ Object



18
19
20
# File 'app/helpers/stats_helper.rb', line 18

def array_of_month_labels(count)
  Array.new(count) { |i| month_label(i) }
end

#font_size(cloud, tag) ⇒ Object



2
3
4
# File 'app/helpers/stats_helper.rb', line 2

def font_size(cloud, tag)
  9 + 2 * cloud.relative_size(tag)
end

#month_and_year_label(i) ⇒ Object



6
7
8
# File 'app/helpers/stats_helper.rb', line 6

def month_and_year_label(i)
  t('date.month_names')[(Time.zone.now.mon - i - 1) % 12 + 1] + " " + (Time.zone.now - i.months).year.to_s
end

#month_label(i) ⇒ Object



14
15
16
# File 'app/helpers/stats_helper.rb', line 14

def month_label(i)
  t('date.month_names')[(Time.zone.now.mon - i - 1) % 12 + 1]
end