Class: Colonel::Parser::Schedule
- Inherits:
-
Object
- Object
- Colonel::Parser::Schedule
- Defined in:
- lib/colonel/parser.rb
Overview
Class to store parsed time fields values
Instance Method Summary collapse
- #days ⇒ Object
- #hours ⇒ Object
-
#initialize(opts = {}) ⇒ Schedule
constructor
A new instance of Schedule.
- #minutes ⇒ Object
- #months ⇒ Object
- #weekdays ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Schedule
Returns a new instance of Schedule.
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/colonel/parser.rb', line 71 def initialize(opts={}) @schedule_tokens = opts[:schedule_tokens] @all_flag = opts[:all_flag].nil? ? true : opts[:all_flag] @_minutes = opts[:minutes] @_hours = opts[:hours] @_days = opts[:days] @_months = opts[:months] @_weekdays = opts[:weekdays] end |
Instance Method Details
#days ⇒ Object
90 91 92 |
# File 'lib/colonel/parser.rb', line 90 def days @_days ||= TimeParser.new(@schedule_tokens.third, :day, @all_flag).result end |
#hours ⇒ Object
86 87 88 |
# File 'lib/colonel/parser.rb', line 86 def hours @_hours ||= TimeParser.new(@schedule_tokens.second, :hour, @all_flag).result end |
#minutes ⇒ Object
82 83 84 |
# File 'lib/colonel/parser.rb', line 82 def minutes @_minutes ||= TimeParser.new(@schedule_tokens.first, :minute, @all_flag).result end |
#months ⇒ Object
94 95 96 |
# File 'lib/colonel/parser.rb', line 94 def months @_months ||= TimeParser.new(@schedule_tokens.fourth, :month, @all_flag).result end |
#weekdays ⇒ Object
98 99 100 |
# File 'lib/colonel/parser.rb', line 98 def weekdays @_weekdays ||= TimeParser.new(@schedule_tokens.fifth, :weekday, @all_flag).result end |