### Home Classes Methods

### In Files

- lib/plugins/list_switch.rb

### Methods

- #call_rubytter
- #list_switch
- #restore
- #split_list_name

### Files

- ChangeLog
- README.rdoc

### Class/Module Index

Quicksearch

- Termtter
- Termtter::API
- Termtter::ActiveRubytter
- Termtter::Client
- Termtter::Client::DirectMessage
- Termtter::Client::Jakigan
- Termtter::Client::SearchEvent
- Termtter::Client::UserSearchEvent
- Termtter::Command
- Termtter::CommandCanceled
- Termtter::CommandLine
- Termtter::CommandNotFound
- Termtter::Config
- Termtter::ConfigSetup
- Termtter::Crypt
- Termtter::English
- Termtter::Event
- Termtter::HTTPpool
- Termtter::Hook
- Termtter::HookCanceled
- Termtter::Hookable
- Termtter::JSONError
- Termtter::MemoryCache
- Termtter::MemoryCache::MemCacheMock
- Termtter::OptParser
- Termtter::Plugin
- Termtter::Plugin::Screen
- Termtter::Plugins
- Termtter::Plugins::Haml
- Termtter::Plugins::ListSwitch
- Termtter::RubytterProxy
- Termtter::RubytterProxy::FrequentAccessError
- Termtter::RubytterProxy::LimitManager
- Termtter::Status
- Termtter::StdOut
- Termtter::Storage
- Termtter::Storage::SQLite3
- Termtter::Storage::Status
- Termtter::Task
- Termtter::TaskManager
- Termtter::TypableIdGenerator
- Termtter::UserStreamReceiver
- Yharian
- Yharian::Alex
- Yharian::Jenifer
- Yharian::Remark
- Yharian::Speaker
- Yharian::Vicki
- Yharian::Yhara
- HatenaKeywordHaiku
- HatenaKeywordHaiku::Word
- OAuth
- OAuth::AccessToken
- Readline
- Readline::LIBREADLINE
- AAMaker
- Array
- BrowserNotFound
- Growl
- IRB
- Object
- Status
- String
- Symbol
- TermColor
- TermtterIrcGateway
- User

No matching classes.

# Termtter::Plugins::ListSwitch

### Attributes

active[R]
list_name[R]
list_user_id[R]
list_user_name[R]

### Public Instance Methods

call_rubytter(rubytter_proxy, method, *args, &block) click to toggle source

    # File lib/plugins/list_switch.rb, line 33
    def call_rubytter(rubytter_proxy, method, *args, &block)
      if active
        case method
        when :home_timeline
          # => list_statuses(user_name, slug, options)
          method, args = :list_statuses, [list_user_name, list_name, *args]
        when :follow
          # => add_member_to_list(slug, user.id)
          method, args = :add_member_to_list, [list_name, *args]
        when :leave
          # => remove_member_from_list(slug, user.id)
          method, args = :remove_member_from_list, [list_name, *args]
        end
      end
      rubytter_proxy.call_rubytter_without_list_switch(method, *args, &block)
    end

list_switch(full_name) click to toggle source

    # File lib/plugins/list_switch.rb, line 50
    def list_switch(full_name)
      @active = true
      @list_user_name, @list_name = split_list_name(full_name)
      user = Termtter::API.twitter.cached_user(list_user_name) ||
                Termtter::API.twitter.user(list_user_name)
      @list_user_id = user.id
      # TODO: やっつけなのでちゃんとやる
      config.prompt = full_name + '> '
    end

restore() click to toggle source

    # File lib/plugins/list_switch.rb, line 60
    def restore
      @active = false
      # TODO: やっつけなのでちゃんとやる
      config.prompt = '> '
    end

split_list_name(list_name) click to toggle source

    # File lib/plugins/list_switch.rb, line 66
    def split_list_name(list_name)
      if /([^\/]+)\/([^\/]+)/ =~ list_name
        [Termtter::Client.normalize_as_user_name($1), $2]
      else
        [config.user_name, $2]
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.