Sha256: 2fb7889946ad54cb5736e8a53d1b5ecb620330fd6ac38c948aced1b57e57dd8b

Contents?: true

Size: 434 Bytes

Versions: 8

Compression:

Stored size: 434 Bytes

Contents

module Crono
  # Crono::PerformerProxy is a proxy used in cronotab.rb semantic
  class PerformerProxy
    def initialize(performer, scheduler)
      @performer = performer
      @scheduler = scheduler
    end

    def every(period, *args)
      job = Job.new(@performer, Period.new(period, *args))
      @scheduler.add_job(job)
    end
  end

  def self.perform(performer)
    PerformerProxy.new(performer, Crono.scheduler)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
crono-0.9.0 lib/crono/performer_proxy.rb
crono-0.8.9 lib/crono/performer_proxy.rb
crono-0.8.9.pre lib/crono/performer_proxy.rb
crono-0.8.8.pre lib/crono/performer_proxy.rb
crono-0.8.7.pre lib/crono/performer_proxy.rb
crono-0.8.6.pre lib/crono/performer_proxy.rb
crono-0.8.1 lib/crono/performer_proxy.rb
crono-0.8.0 lib/crono/performer_proxy.rb