class BuckyBox::API::CachedResponse

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
# File lib/buckybox/api.rb, line 34
def initialize(response)
  @response, @cached_at = response, epoch
end

Public Instance Methods

expired?() click to toggle source
# File lib/buckybox/api.rb, line 38
def expired?
  epoch - @cached_at > 60 # NOTE: cache responses for 60 seconds
end

Private Instance Methods

epoch() click to toggle source
# File lib/buckybox/api.rb, line 42
        def epoch
  Time.now.utc.to_i
end