Skip to Content Skip to Search

class ActiveSupport::Cache::Coder::LazyEntry

Inherits From

Public class methods

Source code GitHub
# File activesupport/lib/active_support/cache/coder.rb, line 99
def initialize(serializer, compressor, payload, **options)
  super(payload, **options)
  @serializer = serializer
  @compressor = compressor
  @resolved = false
end

Public instance methods

Source code GitHub
# File activesupport/lib/active_support/cache/coder.rb, line 114
def mismatched?(version)
  super.tap { |mismatched| value if !mismatched }
rescue Cache::DeserializationError
  true
end
Source code GitHub
# File activesupport/lib/active_support/cache/coder.rb, line 106
def value
  if !@resolved
    @value = @serializer.load(@compressor ? @compressor.inflate(@value) : @value)
    @resolved = true
  end
  @value
end

Definition files