Class: SimpleStream::Client
- Inherits:
-
Object
- Object
- SimpleStream::Client
- Defined in:
- lib/simple_stream/client.rb
Constant Summary collapse
- USER_AGENT =
"SimpleStream Ruby Gem #{SimpleStream::VERSION}"
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #filter(opts = {}, &block) ⇒ Object
- #firehose(opts = {}, &block) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #sample(opts = {}, &block) ⇒ Object
- #site(user_ids, opts = {}, &block) ⇒ Object
- #user(opts = {}, &block) ⇒ Object
Constructor Details
#initialize ⇒ Client
13 14 15 |
# File 'lib/simple_stream/client.rb', line 13 def initialize @connection = SimpleStream::Connection.new end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
9 10 11 |
# File 'lib/simple_stream/client.rb', line 9 def connection @connection end |
Instance Method Details
#filter(opts = {}, &block) ⇒ Object
25 26 27 |
# File 'lib/simple_stream/client.rb', line 25 def filter(opts = {}, &block) request(:post, 'https://stream.twitter.com:443/1.1/statuses/filter.json', opts, &block) end |
#firehose(opts = {}, &block) ⇒ Object
33 34 35 |
# File 'lib/simple_stream/client.rb', line 33 def firehose(opts = {}, &block) request(:get, 'https://stream.twitter.com:443/1.1/statuses/firehose.json', opts, &block) end |
#sample(opts = {}, &block) ⇒ Object
29 30 31 |
# File 'lib/simple_stream/client.rb', line 29 def sample(opts = {}, &block) request(:get, 'https://stream.twitter.com:443/1.1/statuses/sample.json', opts, &block) end |
#site(user_ids, opts = {}, &block) ⇒ Object
17 18 19 |
# File 'lib/simple_stream/client.rb', line 17 def site(user_ids, opts = {}, &block) request(:get, 'https://sitestream.twitter.com:443/1.1/site.json', opts.merge(follow: user_ids.join(',')), &block) end |
#user(opts = {}, &block) ⇒ Object
21 22 23 |
# File 'lib/simple_stream/client.rb', line 21 def user(opts = {}, &block) request(:get, 'https://userstream.twitter.com:443/1.1/user.json', opts, &block) end |