Module: Mappings

Included in:
FlexDate
Defined in:
lib/flex_date/mappings.rb

Constant Summary collapse

MONTHS =
{1 => ['january', 'jan', '1'],
2 => ['february', 'feb', '2'],
3 => ['march', 'mar', '3'],
4 => ['april', 'apr', '4'],
5 => ['may', '5'],
6 => ['june', 'jun', '6'],
7 => ['july', 'jul', '7'],
8 => ['august', 'aug', '8'],
9 => ['september', 'sep', '9'],
10 => ['october', 'oct', '10'],
11 => ['november', 'nov', '11'],
12 => ['december', 'dec', '12']}

Instance Method Summary collapse

Instance Method Details

#parse_month(month) ⇒ Object



16
17
18
# File 'lib/flex_date/mappings.rb', line 16

def parse_month(month)
  MONTHS.select{|k,v| v.include? month.downcase }.keys.first
end