class method self.create

Ruby on Rails 3.2.22.5

Since v3.0.20 Last seen in v3.2.22.5

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

self.create(raw_value, created_at, options = {})

Create an entry with internal attributes set. This method is intended to be used by implementations that store cache entries in a native format instead of as serialized Ruby objects.

Parameters

raw_value req
created_at req
options opt = {}
Source
# File activesupport/lib/active_support/cache.rb, line 541
        def create(raw_value, created_at, options = {})
          entry = new(nil)
          entry.instance_variable_set(:@value, raw_value)
          entry.instance_variable_set(:@created_at, created_at.to_f)
          entry.instance_variable_set(:@compressed, options[:compressed])
          entry.instance_variable_set(:@expires_in, options[:expires_in])
          entry
        end

Defined in activesupport/lib/active_support/cache.rb line 541 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Cache::Entry

Type at least 2 characters to search.

↑↓ navigate · open · esc close