Class: CronTab::NextSeeker
- Inherits:
-
Object
- Object
- CronTab::NextSeeker
- Defined in:
- lib/cron_tab.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#lower_seeker ⇒ Object
Returns the value of attribute lower_seeker.
-
#scalar ⇒ Object
Returns the value of attribute scalar.
Instance Method Summary collapse
-
#initialize(s, f, l) ⇒ NextSeeker
constructor
A new instance of NextSeeker.
- #recursive_zero ⇒ Object
- #succ ⇒ Object
Constructor Details
#initialize(s, f, l) ⇒ NextSeeker
Returns a new instance of NextSeeker.
48 49 50 51 52 |
# File 'lib/cron_tab.rb', line 48 def initialize(s, f, l) self.scalar = s self.field = f self.lower_seeker = l end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
46 47 48 |
# File 'lib/cron_tab.rb', line 46 def field @field end |
#lower_seeker ⇒ Object
Returns the value of attribute lower_seeker.
46 47 48 |
# File 'lib/cron_tab.rb', line 46 def lower_seeker @lower_seeker end |
#scalar ⇒ Object
Returns the value of attribute scalar.
46 47 48 |
# File 'lib/cron_tab.rb', line 46 def scalar @scalar end |
Instance Method Details
#recursive_zero ⇒ Object
65 66 67 68 |
# File 'lib/cron_tab.rb', line 65 def recursive_zero self.scalar = 0 lower_seeker && lower_seeker.recursive_zero end |
#succ ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/cron_tab.rb', line 54 def succ if lower_seeker.nil? || lower_seeker.succ then self.scalar = field.nextof(scalar) scalar else lower_seeker.recursive_zero self.scalar += 1 succ end end |