Module: RactorRailsShim::Registry

Defined in:
lib/ractor_rails_shim/foundation/registry.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.abstract_registryObject (readonly)

Returns the value of attribute abstract_registry.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def abstract_registry
  @abstract_registry
end

.class_attr_valuesObject (readonly)

Returns the value of attribute class_attr_values.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def class_attr_values
  @class_attr_values
end

.class_attributesObject (readonly)

Returns the value of attribute class_attributes.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def class_attributes
  @class_attributes
end

.mattr_defaultsObject (readonly)

Returns the value of attribute mattr_defaults.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def mattr_defaults
  @mattr_defaults
end

.shareable_class_ivarsObject (readonly)

Returns the value of attribute shareable_class_ivars.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def shareable_class_ivars
  @shareable_class_ivars
end

.shareable_constantsObject (readonly)

Returns the value of attribute shareable_constants.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def shareable_constants
  @shareable_constants
end

.shareable_fallbackObject (readonly)

Returns the value of attribute shareable_fallback.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def shareable_fallback
  @shareable_fallback
end

.shareable_mattr_defaultsObject (readonly)

Returns the value of attribute shareable_mattr_defaults.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def shareable_mattr_defaults
  @shareable_mattr_defaults
end

.view_context_registryObject (readonly)

Returns the value of attribute view_context_registry.



36
37
38
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 36

def view_context_registry
  @view_context_registry
end

Class Method Details

.reassign_abstract_registry(value) ⇒ Object



54
55
56
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 54

def reassign_abstract_registry(value)
  @abstract_registry = value
end

.reassign_shareable_fallback(value) ⇒ Object

Swap the frozen (shareable) registries. The value MUST already be frozen + Ractor.make_shareable. Each reassign_* updates the instance variable; the facade alias (defined in patches/core.rb) re-reads it on every access, so the alias tracks the new value without a const_set on the facade singleton.



46
47
48
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 46

def reassign_shareable_fallback(value)
  @shareable_fallback = value
end

.reassign_shareable_mattr_defaults(value) ⇒ Object



50
51
52
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 50

def reassign_shareable_mattr_defaults(value)
  @shareable_mattr_defaults = value
end

.reassign_view_context_registry(value) ⇒ Object



58
59
60
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 58

def reassign_view_context_registry(value)
  @view_context_registry = value
end

.reset_allObject

Test seam: reset all nine registries to their boot defaults. Used by specs that mutate the registries and need a clean slate.



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/ractor_rails_shim/foundation/registry.rb', line 64

def reset_all
  @class_attributes = []
  @mattr_defaults = {}
  @class_attr_values = {}
  @shareable_mattr_defaults = {}
  @shareable_constants = []
  @shareable_class_ivars = []
  @abstract_registry = Ractor.make_shareable({})
  @view_context_registry = Ractor.make_shareable({})
  @shareable_fallback = Ractor.make_shareable({})
end