Class: Ractor::Cache::Strategy::Base
- Inherits:
-
Object
- Object
- Ractor::Cache::Strategy::Base
- Defined in:
- lib/ractor/cache/strategy.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
Instance Method Summary collapse
- #compile_store_init ⇒ Object
-
#initialize(instance_method) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(instance_method) ⇒ Base
Returns a new instance of Base.
11 12 13 14 |
# File 'lib/ractor/cache/strategy.rb', line 11 def initialize(instance_method) @method_name = instance_method.name analyse_parameters(instance_method.parameters) end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
9 10 11 |
# File 'lib/ractor/cache/strategy.rb', line 9 def method_name @method_name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
9 10 11 |
# File 'lib/ractor/cache/strategy.rb', line 9 def parameters @parameters end |
Instance Method Details
#compile_store_init ⇒ Object
16 17 18 19 |
# File 'lib/ractor/cache/strategy.rb', line 16 def compile_store_init init = @has_arguments ? "Hash.new { #{EMPTY_CACHE} }" : EMPTY_CACHE "@#{method_name} = #{init}" end |