-
Notifications
You must be signed in to change notification settings - Fork 154
/
tweetstream.rb
36 lines (31 loc) · 924 Bytes
/
tweetstream.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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