### Home Classes Methods

### In Files

- lib/termtter/rubytter_proxy.rb

### Parent

Object

### Methods

- ::new
- #get
- #safe?

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Termtter
- Termtter::API
- Termtter::ActiveRubytter
- Termtter::Client
- Termtter::Client::UserSearchEvent
- Termtter::Command
- Termtter::CommandLine
- Termtter::Config
- Termtter::ConfigSetup
- Termtter::Crypt
- 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::RubytterProxy
- Termtter::RubytterProxy::FrequentAccessError
- Termtter::RubytterProxy::LimitManager
- Termtter::Status
- Termtter::Storage
- Termtter::Storage::Status
- Termtter::Task
- Termtter::TaskManager
- Termtter::UserStreamReceiver
- OAuth
- OAuth::AccessToken
- Array
- Growl
- IRB
- Object
- Readline
- Status
- String
- Symbol
- TermColor
- 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.