Class: CloudwatchChrono::Fields::Wday
- Inherits:
-
Chrono::Fields::Wday
- Object
- Chrono::Fields::Wday
- CloudwatchChrono::Fields::Wday
- Defined in:
- lib/cloudwatch_chrono/fields/wday.rb
Constant Summary collapse
- CLOUDWATCH_REGEXP =
%r<\A(?:(?<step>(?:\*|\?|(?:(?<atom>\d+|sun|mon|tue|wed|thu|fri|sat)(?:-\g<atom>)?))(?:/\d+)?)(?:,\g<step>)*)\z>ix.freeze
Instance Method Summary collapse
-
#initialize(source) ⇒ Wday
constructor
A new instance of Wday.
- #interpolated ⇒ Object
Constructor Details
#initialize(source) ⇒ Wday
Returns a new instance of Wday.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cloudwatch_chrono/fields/wday.rb', line 8 def initialize(source) if source == 'L' @last_wday = true else unless CLOUDWATCH_REGEXP =~ source raise InvalidField.new('Unparsable field', source) end end @source = source end |
Instance Method Details
#interpolated ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/cloudwatch_chrono/fields/wday.rb', line 19 def interpolated if @last_wday '6-6' else super.gsub("?", "#{range.first}-#{range.last}") end end |