Class: Ractor::Cache::Strategy::Disable

Inherits:
Base
  • Object
show all
Defined in:
lib/ractor/cache/strategy.rb

Instance Attribute Summary

Attributes inherited from Base

#method_name, #parameters

Instance Method Summary collapse

Methods inherited from Base

#compile_store_init, #initialize

Constructor Details

This class inherits a constructor from Ractor::Cache::Strategy::Base

Instance Method Details

#compile_accessorObject



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/ractor/cache/strategy.rb', line 73

def compile_accessor
  <<~RUBY
    def #{method_name}(#{signature})
      ractor_cache.#{method_name}#{compile_lookup} || begin
        result = super
        ractor_cache.#{method_name}#{compile_lookup} = result unless ractor_cache.frozen?
        result
      end
    end
  RUBY
end

#deep_freeze_callback(instance) ⇒ Object



85
86
87
# File 'lib/ractor/cache/strategy.rb', line 85

def deep_freeze_callback(instance)
  # nothing to do
end