Class: ActiveSupport::Cache::Coder::LazyEntry
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
ActiveSupport::Cache::Entry
|
| Defined in: | activesupport/lib/active_support/cache/coder.rb |
Class Method Summary
::ActiveSupport::Cache::Entry - Inherited
Instance Attribute Summary
::ActiveSupport::Cache::Entry - Inherited
| #compressed?, | |
| #expired? | Checks if the entry is expired. |
| #expires_at, #expires_at=, #local?, #version | |
Instance Method Summary
::ActiveSupport::Cache::Entry - Inherited
| #bytesize | Returns the size of the cached value. |
| #compressed, | |
| #dup_value! | Duplicates the value in a class. |
| #mismatched?, #pack, #value, #marshal_load, #uncompress | |
Constructor Details
.new(serializer, compressor, payload, **options) ⇒ LazyEntry
# File 'activesupport/lib/active_support/cache/coder.rb', line 99
def initialize(serializer, compressor, payload, **) super(payload, **) @serializer = serializer @compressor = compressor @resolved = false end
Instance Method Details
#mismatched?(version) ⇒ Boolean
# File 'activesupport/lib/active_support/cache/coder.rb', line 114
def mismatched?(version) super.tap { |mismatched| value if !mismatched } rescue Cache::DeserializationError true end
#value
[ 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