Class: Geostats::Views::MonthlyFounds
- Defined in:
- lib/geostats/views/monthly_founds.rb
Constant Summary collapse
- HEIGHT =
140
Instance Method Summary collapse
-
#initialize ⇒ MonthlyFounds
constructor
A new instance of MonthlyFounds.
- #monthly_founds ⇒ Object
Constructor Details
#initialize ⇒ MonthlyFounds
Returns a new instance of MonthlyFounds.
6 7 8 9 10 |
# File 'lib/geostats/views/monthly_founds.rb', line 6 def initialize @founds = Stats.monthly_founds(12).reverse @max = @founds.map { |a| a[1] }.max @factor = HEIGHT.to_f / @max.to_f end |
Instance Method Details
#monthly_founds ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/geostats/views/monthly_founds.rb', line 12 def monthly_founds @founds.map do |date, count| { :height => [1, count * @factor].max, :founds => count, :month => date.strftime("%b"), :year => date.strftime("%Y") } end end |