Parent

TweetStream::SiteStreamClient

Public Class Methods

new(config_uri, oauth = {}) click to toggle source
# File lib/tweetstream/site_stream_client.rb, line 10
def initialize(config_uri, oauth = {})
  @config_uri = config_uri

  options = TweetStream.oauth_options.merge(oauth)
  Configuration::OAUTH_OPTIONS_KEYS.each do |key|
    send("#{key}=", options[key])
  end

  EventMachine::HttpRequest.use EventMachine::Middleware::JSONResponse
end

Public Instance Methods

add_user(user_id, &block) click to toggle source
# File lib/tweetstream/site_stream_client.rb, line 35
def add_user(user_id, &block)
  options = {
              :error_msg => 'Failed to add user to SiteStream',
              :body => { 'user_id' => normalized_user_ids(user_id) }
            }

  request(:post, add_user_path, options, &block)
end
friends_ids(user_id, &block) click to toggle source
# File lib/tweetstream/site_stream_client.rb, line 53
def friends_ids(user_id, &block)
  options = { :error_msg => 'Failed to retrieve SiteStream friends ids.',
              :body => { 'user_id' => user_id }
            }
  request(:post, friends_ids_path, options, &block)
end
info(&block) click to toggle source
# File lib/tweetstream/site_stream_client.rb, line 30
def info(&block)
  options = { :error_msg => 'Failed to retrieve SiteStream info.' }
  request(:get, info_path, options, &block)
end
on_error(&block) click to toggle source
# File lib/tweetstream/site_stream_client.rb, line 21
def on_error(&block)
  if block_given?
    @on_error = block
    self
  else
    @on_error
  end
end
remove_user(user_id, &block) click to toggle source
# File lib/tweetstream/site_stream_client.rb, line 44
def remove_user(user_id, &block)
  options = {
              :error_msg => 'Failed to remove user from SiteStream.',
              :body => { 'user_id' => normalized_user_ids(user_id) }
            }

  request(:post, remove_user_path, options, &block)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.