Class: Chrono::Fields::Month
Constant Summary collapse
- TABLE =
{ 'jan' => '1', 'feb' => '2', 'mar' => '3', 'apr' => '4', 'may' => '5', 'jun' => '6', 'jul' => '7', 'aug' => '8', 'sep' => '9', 'oct' => '10', 'nov' => '11', 'dec' => '12', }
- REGEXP =
%r<\A(?<step>(?:\*|(?:(?<atom>\d+||jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(?:-\g<atom>)?))(?:/\d+)?)(?:,\g<step>)*\z>ix
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(source) ⇒ Month
constructor
A new instance of Month.
Methods inherited from Base
Constructor Details
#initialize(source) ⇒ Month
Returns a new instance of Month.
20 21 22 23 24 25 |
# File 'lib/chrono/fields/month.rb', line 20 def initialize(source) unless REGEXP =~ source raise InvalidField.new('Unparsable field', source) end @source = source end |