Class: ActiveSupport::Cache::WriteOptions
- Defined in:
 - activesupport/lib/active_support/cache.rb
 
Overview
Enables the dynamic configuration of Cache entry options while ensuring that conflicting options are not both set. When a block is given to ActiveSupport::Cache::Store#fetch, the second argument will be an instance of WriteOptions.
Instance Method Summary collapse
- #expires_at ⇒ Object
 - 
  
    
      #expires_at=(expires_at)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Sets the Cache entry’s
expires_atvalue. - #expires_in ⇒ Object
 - 
  
    
      #expires_in=(expires_in)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Sets the Cache entry’s
expires_invalue. - 
  
    
      #initialize(options)  ⇒ WriteOptions 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
:nodoc:.
 - #version ⇒ Object
 - #version=(version) ⇒ Object
 
Constructor Details
#initialize(options) ⇒ WriteOptions
:nodoc:
      1069 1070 1071  | 
    
      # File 'activesupport/lib/active_support/cache.rb', line 1069 def initialize() # :nodoc: = end  | 
  
Instance Method Details
#expires_at ⇒ Object
      1093 1094 1095  | 
    
      # File 'activesupport/lib/active_support/cache.rb', line 1093 def expires_at [:expires_at] end  | 
  
#expires_at=(expires_at) ⇒ Object
Sets the Cache entry’s expires_at value. If an expires_in option was previously set, this will unset it since expires_at and expires_in cannot both be set.
      1100 1101 1102 1103  | 
    
      # File 'activesupport/lib/active_support/cache.rb', line 1100 def expires_at=(expires_at) .delete(:expires_in) [:expires_at] = expires_at end  | 
  
#expires_in ⇒ Object
      1081 1082 1083  | 
    
      # File 'activesupport/lib/active_support/cache.rb', line 1081 def expires_in [:expires_in] end  | 
  
#expires_in=(expires_in) ⇒ Object
Sets the Cache entry’s expires_in value. If an expires_at option was previously set, this will unset it since expires_in and expires_at cannot both be set.
      1088 1089 1090 1091  | 
    
      # File 'activesupport/lib/active_support/cache.rb', line 1088 def expires_in=(expires_in) .delete(:expires_at) [:expires_in] = expires_in end  | 
  
#version ⇒ Object
      1073 1074 1075  | 
    
      # File 'activesupport/lib/active_support/cache.rb', line 1073 def version [:version] end  | 
  
#version=(version) ⇒ Object
      1077 1078 1079  | 
    
      # File 'activesupport/lib/active_support/cache.rb', line 1077 def version=(version) [:version] = version end  |