Class: Async::Cron::Schedule::Flags
- Inherits:
-
Object
- Object
- Async::Cron::Schedule::Flags
- Defined in:
- lib/async/cron/schedule/flags.rb
Class Method Summary collapse
Instance Method Summary collapse
- #drop? ⇒ Boolean
-
#initialize(drop: true) ⇒ Flags
constructor
A new instance of Flags.
Constructor Details
#initialize(drop: true) ⇒ Flags
Returns a new instance of Flags.
27 28 29 |
# File 'lib/async/cron/schedule/flags.rb', line 27 def initialize(drop: true) @drop = drop end |
Class Method Details
.parse(string) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/async/cron/schedule/flags.rb', line 10 def self.parse(string) = {} string&.each_char do |character| case character when 'D' [:drop] = true when 'd' [:drop] = false else raise ArgumentError, "Invalid flag: #{character}" end end self.new(**) end |
Instance Method Details
#drop? ⇒ Boolean
31 32 33 |
# File 'lib/async/cron/schedule/flags.rb', line 31 def drop? @drop end |