Class: Colonel::Crontab::TimeCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/colonel/crontab.rb

Instance Method Summary collapse

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

#generateObject



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