Class: Tw::Client::Stream

### Home Classes Methods

### In Files

- lib/tw/client/stream.rb

### Parent

Object

### Methods

- ::new
- #filter
- #user_stream

### Class/Module Index

Quicksearch

- Tw
- Tw::App
- Tw::App::Main
- Tw::App::Render
- Tw::Auth
- Tw::Client
- Tw::Client::Stream
- Tw::Conf
- Tw::Error
- Tw::Tweet
- String

No matching classes.

# Tw::Client::Stream

### Public Class Methods

new(user=nil) click to toggle source

    # File lib/tw/client/stream.rb, line 4
    def initialize(user=nil)
      user = Tw::Auth.get_or_regist_user user
      UserStream.configure do |config|
        config.consumer_key = Conf['consumer_key']
        config.consumer_secret = Conf['consumer_secret']
        config.oauth_token = user['access_token']
        config.oauth_token_secret = user['access_secret']
      end

      @client = UserStream::Client.new
    end

### Public Instance Methods

filter(*track_words, &block) click to toggle source

    # File lib/tw/client/stream.rb, line 25
    def filter(*track_words, &block)
      raise ArgumentError, 'block not given' unless block_given?
      @client.filter :track => track_words.join(',') do |m|
        if data = tweet?(m)
          yield data
        end
      end
    end

user_stream(&block) click to toggle source

    # File lib/tw/client/stream.rb, line 16
    def user_stream(&block)
      raise ArgumentError, 'block not given' unless block_given?
      @client.user do |m|
        if data = tweet?(m)
          yield data
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.