Sha256: 3e895ea403c9b8dbd07eea8ba6cce6cfe0885964e92fffa799dca5248b0af35b

Contents?: true

Size: 626 Bytes

Versions: 7

Compression:

Stored size: 626 Bytes

Contents

module MiniScheduler::Schedule

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

  def every(duration = nil)
    if duration
      @every = duration
      if manager = MiniScheduler::Manager.current
        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

7 entries across 7 versions & 1 rubygems

Version Path
mini_scheduler-0.9.2 lib/mini_scheduler/schedule.rb
mini_scheduler-0.9.1 lib/mini_scheduler/schedule.rb
mini_scheduler-0.9.0 lib/mini_scheduler/schedule.rb
mini_scheduler-0.8.3 lib/mini_scheduler/schedule.rb
mini_scheduler-0.8.2 lib/mini_scheduler/schedule.rb
mini_scheduler-0.8.1 lib/mini_scheduler/schedule.rb
mini_scheduler-0.8.0 lib/mini_scheduler/schedule.rb