Module: HTTPX::Plugins::Cache::RequestMethods

Defined in:
lib/httpx/plugins/cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cached_responseObject

points to a previously cached Response corresponding to this request.



167
168
169
# File 'lib/httpx/plugins/cache.rb', line 167

def cached_response
  @cached_response
end

Instance Method Details

#initializeObject



169
170
171
172
# File 'lib/httpx/plugins/cache.rb', line 169

def initialize(*)
  super
  @cached_response = nil
end

#merge_headersObject



174
175
176
177
# File 'lib/httpx/plugins/cache.rb', line 174

def merge_headers(*)
  super
  @response_cache_key = nil
end

#response_cache_keyObject

returns a unique cache key as a String identifying this request



180
181
182
183
184
# File 'lib/httpx/plugins/cache.rb', line 180

def response_cache_key
  return unless (call = @options.cache_key)

  call[self]
end