Sha256: 83966c5659f46dbfd9297d2c565ff596240f7791ae1664f708cd23c1ac2d270f
Contents?: true
Size: 612 Bytes
Versions: 20
Compression:
Stored size: 612 Bytes
Contents
# encoding: utf-8 require 'faraday' module Github module Request class Caching < Faraday::Middleware attr_reader :cache def initialize(app, cache = nil, options={}) super(app) @cache = cache || Proc.new{}.call end def call(env) if env[:method] == :get # TODO choose cache method # file_store # mem_cache_store # memory_store else @app.call(env) end end def cache_key url = env[:url].dup if url.query end end end end # Request end # Github
Version data entries
20 entries across 20 versions & 1 rubygems