Module: TimeCrisis::NamedMonths

Included in:
Date, Date
Defined in:
lib/time_crisis/named_months.rb

Instance Method Summary collapse

Instance Method Details

#april(year = nil) ⇒ Object



15
16
17
# File 'lib/time_crisis/named_months.rb', line 15

def april(year=nil)
  month_range(4, year)
end

#august(year = nil) ⇒ Object



31
32
33
# File 'lib/time_crisis/named_months.rb', line 31

def august(year=nil)
  month_range(8, year)
end

#december(year = nil) ⇒ Object



47
48
49
# File 'lib/time_crisis/named_months.rb', line 47

def december(year=nil)
  month_range(12, year)
end

#february(year = nil) ⇒ Object



7
8
9
# File 'lib/time_crisis/named_months.rb', line 7

def february(year=nil)
  month_range(2, year)
end

#january(year = nil) ⇒ Object



3
4
5
# File 'lib/time_crisis/named_months.rb', line 3

def january(year=nil)
  month_range(1, year)
end

#july(year = nil) ⇒ Object



27
28
29
# File 'lib/time_crisis/named_months.rb', line 27

def july(year=nil)
  month_range(7, year)
end

#june(year = nil) ⇒ Object



23
24
25
# File 'lib/time_crisis/named_months.rb', line 23

def june(year=nil)
  month_range(6, year)
end

#march(year = nil) ⇒ Object



11
12
13
# File 'lib/time_crisis/named_months.rb', line 11

def march(year=nil)
  month_range(3, year)
end

#may(year = nil) ⇒ Object



19
20
21
# File 'lib/time_crisis/named_months.rb', line 19

def may(year=nil)
  month_range(5, year)
end

#month_range(month = nil, year = nil) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/time_crisis/named_months.rb', line 51

def month_range(month=nil, year=nil)
  month ||= current.month
  year ||= current.year

  base = TimeCrisis::Date.civil(year, month, 1)
  base.for(1, 'months')
end

#november(year = nil) ⇒ Object



43
44
45
# File 'lib/time_crisis/named_months.rb', line 43

def november(year=nil)
  month_range(11, year)
end

#october(year = nil) ⇒ Object



39
40
41
# File 'lib/time_crisis/named_months.rb', line 39

def october(year=nil)
  month_range(10, year)
end

#september(year = nil) ⇒ Object



35
36
37
# File 'lib/time_crisis/named_months.rb', line 35

def september(year=nil)
  month_range(9, year)
end