class method
self.create
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v3.2.22.5Signature
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_valuereq -
created_atreq -
optionsopt = {}
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