Sha256: 8c0d29ce0b233ecaa5ba84485ca57e8ea5d3cec79b3f0c5a98a1666260151a7a

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

module MiniScheduler::Schedule

  def queue(value = nil)
    @queue = value.to_s if value
    @queue ||= "default"
  end

  def daily(options = nil)
    if options
      @daily = options
    end
    @daily
  end

  def every(duration = nil)
    if duration
      @every = duration
      if manager = MiniScheduler::Manager.current[queue]
        manager.ensure_schedule!(self)
      end
    end
    @every
  end

  # schedule job independently on each host (looking at hostname)
  def per_host
    @per_host = true
  end

  def is_per_host
    @per_host
  end

  def schedule_info
    manager = MiniScheduler::Manager.without_runner
    manager.schedule_info self
  end

  def scheduled?
    !!@every || !!@daily
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mini_scheduler-0.10.0 lib/mini_scheduler/schedule.rb