Class: Colonel::Crontab::TimeCreator
- Inherits:
-
Object
- Object
- Colonel::Crontab::TimeCreator
- Defined in:
- lib/colonel/crontab.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(opts = {}) ⇒ TimeCreator
constructor
A new instance of TimeCreator.
Constructor Details
#initialize(opts = {}) ⇒ TimeCreator
Returns a new instance of TimeCreator.
60 61 62 63 64 65 66 |
# File 'lib/colonel/crontab.rb', line 60 def initialize(opts={}) @minutes = opts[:minutes] @hours = opts[:hours] @days = opts[:days] @months = opts[:months] @weekdays = opts[:weekdays] end |
Instance Method Details
#generate ⇒ Object
68 69 70 |
# File 'lib/colonel/crontab.rb', line 68 def generate [@minutes, @hours, @days, @months, @weekdays].map { |t| t.is_a?(Array) ? t.join(",") : t }.join(" ")#.join("\t") end |