Sha256: 3c45319cc95c51c418b5ad2be032dfa5410d8572116747513f076f65b8f265ee

Contents?: true

Size: 687 Bytes

Versions: 15

Compression:

Stored size: 687 Bytes

Contents

require_relative 'rest'
require_relative '../bot'

module Elephrame
  module Bots

    ##
    # a bot that runs commands based off of
    # an interval or a cron string

    class Periodic < BaseBot
      include Elephrame::Scheduler

      ##
      # creates a new Periodic bot
      #
      # @param intv [String] string specifying interval to post.
      #        ex: '3h' (every 3 hours) '20m' (every 20 minutes)
      #       '00 12 * * *' (every day at 12:00)
      #       '00 00 25 12 *' (midnight on christmas)
      #
      # @return [Elephrame::Bots::Periodic]
      
      def initialize intv
        super()
        
        setup_scheduler intv
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
elephrame-0.5.2 lib/elephrame/rest/bots.rb
elephrame-0.5.1 lib/elephrame/rest/bots.rb
elephrame-0.5 lib/elephrame/rest/bots.rb
elephrame-0.4.6 lib/elephrame/rest/bots.rb
elephrame-0.4.5 lib/elephrame/rest/bots.rb
elephrame-0.4.4 lib/elephrame/rest/bots.rb
elephrame-0.4.3 lib/elephrame/rest/bots.rb
elephrame-0.4.2 lib/elephrame/rest/bots.rb
elephrame-0.4.1 lib/elephrame/rest/bots.rb
elephrame-0.4.0 lib/elephrame/rest/bots.rb
elephrame-0.3.7 lib/elephrame/rest/bots.rb
elephrame-0.3.6 lib/elephrame/rest/bots.rb
elephrame-0.3.4 lib/elephrame/rest/bots.rb
elephrame-0.3.3 lib/elephrame/rest/bots.rb
elephrame-0.3.2 lib/elephrame/rest/bots.rb