Module: HTTPX::Plugins::Cache::ResponseMethods

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#original_requestObject

a copy of the request this response was originally cached from



196
197
198
# File 'lib/httpx/plugins/cache.rb', line 196

def original_request
  @original_request || @request
end

Instance Method Details

#cached?Boolean

whether this Response was duplicated from a previously HTTPX::Plugins::Cache::RequestMethods#cached_response.

Returns:

  • (Boolean)


201
202
203
# File 'lib/httpx/plugins/cache.rb', line 201

def cached?
  @cached
end

#initializeObject



190
191
192
193
# File 'lib/httpx/plugins/cache.rb', line 190

def initialize(*)
  super
  @cached = false
end

#mark_as_cached!Object

sets this Response as being duplicated from a previously cached response.



206
207
208
# File 'lib/httpx/plugins/cache.rb', line 206

def mark_as_cached!
  @cached = true
end