Module: YearArray::TimeHelpers::ClassMethods

Defined in:
lib/year_array/time_helpers.rb

Instance Method Summary collapse

Instance Method Details

#hours_between(t1, t2) ⇒ Object



16
17
18
# File 'lib/year_array/time_helpers.rb', line 16

def hours_between(t1, t2)
  ((t2-t1)/3600).to_i
end

#hours_in_day(year, month, day) ⇒ Object



12
13
14
# File 'lib/year_array/time_helpers.rb', line 12

def hours_in_day(year, month, day)
  hours_in_interval(:day, year, month, day)
end

#hours_in_month(year, month) ⇒ Object



8
9
10
# File 'lib/year_array/time_helpers.rb', line 8

def hours_in_month(year, month)
  hours_in_interval(:month, year, month)
end

#hours_in_year(year) ⇒ Object



4
5
6
# File 'lib/year_array/time_helpers.rb', line 4

def hours_in_year(year)
  hours_in_interval(:year, year)
end