Sha256: 2cf0e03ad8ccd5e2a8deb28d7d32312c7b778950657f277b140200b8a4911e29

Contents?: true

Size: 924 Bytes

Versions: 7

Compression:

Stored size: 924 Bytes

Contents

require 'tweetstream/configuration'
require 'tweetstream/client'
require 'tweetstream/daemon'

module TweetStream
  extend Configuration

  class ReconnectError < StandardError
    attr_accessor :timeout, :retries
    def initialize(timeout, retries)
      self.timeout = timeout
      self.retries = retries
      super("Failed to reconnect after #{retries} tries.")
    end
  end

  class << self
    # Alias for TweetStream::Client.new
    #
    # @return [TweetStream::Client]
    def new(options={})
      TweetStream::Client.new(options)
    end

    # Delegate to TweetStream::Client
    def method_missing(method, *args, &block)
      return super unless new.respond_to?(method)
      new.send(method, *args, &block)
    end

    # Delegate to TweetStream::Client
    def respond_to?(method, include_private = false)
      new.respond_to?(method, include_private) || super(method, include_private)
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
tweetstream-2.6.0 lib/tweetstream.rb
jls-tweetstream-2.5.0 lib/tweetstream.rb
tweetstream-2.5.0 lib/tweetstream.rb
tweetstream-2.4.0 lib/tweetstream.rb
tweetstream-2.3.0 lib/tweetstream.rb
tweetstream-2.2.0 lib/tweetstream.rb
tweetstream-2.1.0 lib/tweetstream.rb