Sha256: 2d95b3f1a39d49c87fb5067039b6f4beb40564c9fb9a4f3ae72f636a2900f95c

Contents?: true

Size: 452 Bytes

Versions: 1

Compression:

Stored size: 452 Bytes

Contents

require 'say_when/triggers/base'

module SayWhen
  module Triggers
    class ScheduledStrategy

      include SayWhen::Triggers::Base

      attr_accessor :scheduled, :next_at_method

      def initialize(options={})
        @scheduled       = @job.scheduled
        @next_at_method  = options[:next_at_method] || 'next_fire_at'
      end

      def next_fire_at(time=Time.now)
        scheduled.send(next_at_method, time)
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
say_when-0.2.0 lib/say_when/triggers/scheduled_strategy.rb