### Home Classes Methods

### In Files

- lib/termtter/rubytter_proxy.rb

### Parent

Object

### Methods

- ::new
- #get
- #safe?

### 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::RubytterProxy::LimitManager

### Public Class Methods

new(rubytter) click to toggle source

    # File lib/termtter/rubytter_proxy.rb, line 181
    def initialize(rubytter)
      @rubytter = rubytter
      @limit = nil
      @count = 0
    end

### Public Instance Methods

get() click to toggle source

    # File lib/termtter/rubytter_proxy.rb, line 187
    def get
      @count += 1
      if @count > 5 || !@limit
        @count = 0
        @limit = @rubytter.limit_status
      end
      @limit
    end

safe?() click to toggle source

    # File lib/termtter/rubytter_proxy.rb, line 196
    def safe?
      limit = self.get
      threshold = [(Time.parse(limit.reset_time) - Time.now) / 3600 - 0.1, 0.1].max * limit.hourly_limit
      threshold < limit.remaining_hits
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.