Method: APICache::API#initialize

Defined in:
lib/api_cache/api.rb

#initialize(key, options, &block) ⇒ API

Takes the following options

period

Maximum frequency to call the API. If set to 0 then there is no limit on how frequently queries can be made to the API.

timeout

Timeout when calling api (either to the proviced url or excecuting the passed block)

block

If passed then the block is excecuted instead of HTTP GET against the provided key



19
20
21
22
23
# File 'lib/api_cache/api.rb', line 19

def initialize(key, options, &block)
  @key, @block = key, block
  @timeout = options[:timeout]
  @period = options[:period]
end