class Minicron::Hub::Schedule

Public Class Methods

format(schedule) click to toggle source

Format the schedule based on all it's components

@param schedule [Minicron::Hub::Schedule] @return string

# File lib/minicron/hub/models/schedule.rb, line 18
def self.format(schedule)
  # If it's not a 'special' schedule then build up the full schedule string
  if schedule.special == '' || schedule.special.nil?
    "#{schedule.minute} #{schedule.hour} #{schedule.day_of_the_month} #{schedule.month} #{schedule.day_of_the_week}"
  else
    schedule.special
  end
end

Public Instance Methods

formatted() click to toggle source

The formatted schedule

# File lib/minicron/hub/models/schedule.rb, line 10
def formatted
  Minicron::Hub::Schedule.format(self)
end