Sha256: fbf9cae4e24b5a33291daf36d660533b06e87dac8dd63cb15dfe43c42eb0bfdc

Contents?: true

Size: 300 Bytes

Versions: 15

Compression:

Stored size: 300 Bytes

Contents

module Topsy
  
  class RateLimitInfo < Hashie::Dash
    
    property :reset
    property :limit
    property :remaining
    
    def refresh_in_seconds
      Time.at(reset) - Time.now
    end
    
    def reset
      Time.at(self[:reset]) unless self[:reset].respond_to?(:year)
    end
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
topsy-1.0.1 lib/topsy/rate_limit_info.rb
topsy-1.0.0 lib/topsy/rate_limit_info.rb
topsy-0.6.0 lib/topsy/rate_limit_info.rb
topsy-0.5.1 lib/topsy/rate_limit_info.rb
topsy-0.5.0 lib/topsy/rate_limit_info.rb
topsy-0.4.0 lib/topsy/rate_limit_info.rb
topsy-0.3.6 lib/topsy/rate_limit_info.rb
topsy-0.3.5 lib/topsy/rate_limit_info.rb
topsy-0.3.4 lib/topsy/rate_limit_info.rb
topsy-0.3.3 lib/topsy/rate_limit_info.rb
topsy-0.3.2 lib/topsy/rate_limit_info.rb
topsy-0.3.1 lib/topsy/rate_limit_info.rb
topsy-0.2.1 lib/topsy/rate_limit_info.rb
topsy-0.3.0 lib/topsy/rate_limit_info.rb
topsy-0.2.0 lib/topsy/rate_limit_info.rb