Class: Chrono::Fields::Wday
Constant Summary collapse
- TABLE =
{ '7' => '0', 'sun' => '0', 'mon' => '1', 'tue' => '2', 'wed' => '3', 'thu' => '4', 'fri' => '5', 'sat' => '6', }
- REGEXP =
%r<\A(?:(?<step>(?:\*|(?:(?<atom>\d+|sun|mon|tue|wed|thu|fri|sat)(?:-\g<atom>)?))(?:/\d+)?)(?:,\g<step>)*)\z>ix
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(source) ⇒ Wday
constructor
A new instance of Wday.
Methods inherited from Base
Constructor Details
#initialize(source) ⇒ Wday
Returns a new instance of Wday.
16 17 18 19 20 21 |
# File 'lib/chrono/fields/wday.rb', line 16 def initialize(source) unless REGEXP =~ source raise InvalidField.new('Unparsable field', source) end @source = source end |