Module: Typhoeus::Response::Cacheable

Included in:
Typhoeus::Response
Defined in:
lib/typhoeus/response/cacheable.rb

Overview

Since:

  • 0.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cached=(value) ⇒ Object (writeonly)

Set the cache status, if we got response from cache it will have cached? == true

Since:

  • 0.5.0



7
8
9
# File 'lib/typhoeus/response/cacheable.rb', line 7

def cached=(value)
  @cached = value
end

Instance Method Details

#cached?Boolean

Returns:

  • (Boolean)

Since:

  • 0.5.0



9
10
11
# File 'lib/typhoeus/response/cacheable.rb', line 9

def cached?
  defined?(@cached) ? !!@cached : false
end