Sha256: a8c5adf169052d0608e04a1eec5e00cc5540e5d311cfad5324f55f65b2f56645
Contents?: true
Size: 640 Bytes
Versions: 12
Compression:
Stored size: 640 Bytes
Contents
module Elephrame module Scheduler attr :scheduler, :interval attr_reader :schedule ## # Creates a new scheduler # # @param intv [String] string specifying interval to post def setup_scheduler intv require 'rufus-scheduler' @interval = intv @scheduler = Rufus::Scheduler.new end ## # Runs the schedule. Requires a block to be passed to it. def run_scheduled @scheduler.repeat @interval do |j| @schedule = j yield(self) end @scheduler.join unless not @streamer.nil? end alias_method :run, :run_scheduled end end
Version data entries
12 entries across 12 versions & 1 rubygems