Class: Railsmith::DomainContext Deprecated
- Defined in:
- lib/railsmith/domain_context.rb
Overview
Deprecated.
Use Railsmith::Context instead.
Kept for one major version to allow migration. Will be removed in the next major release.
Instance Attribute Summary
Attributes inherited from Context
Class Method Summary collapse
-
.new(current_domain: nil, meta: {}, **extras) ⇒ Object
Overrides Context.new to: - emit a class-level deprecation warning - map the old
meta:keyword to top-level extras.
Instance Method Summary collapse
-
#meta ⇒ Object
Backward-compatible reader.
Methods inherited from Context
#[], #blank_domain?, build, current, current=, #current_domain, #initialize, normalize_current_domain, #request_id, #to_h, with
Constructor Details
This class inherits a constructor from Railsmith::Context
Class Method Details
.new(current_domain: nil, meta: {}, **extras) ⇒ Object
Overrides Context.new to:
- emit a class-level deprecation warning
- map the old +meta:+ keyword to top-level extras
12 13 14 15 16 |
# File 'lib/railsmith/domain_context.rb', line 12 def self.new(current_domain: nil, meta: {}, **extras) warn "[DEPRECATION] Railsmith::DomainContext is deprecated; use Railsmith::Context instead." merged_extras = ( || {}).merge(extras) super(domain: current_domain, **merged_extras) end |
Instance Method Details
#meta ⇒ Object
Backward-compatible reader. Returns the stored extras (the former :meta hash).
19 20 21 |
# File 'lib/railsmith/domain_context.rb', line 19 def @extras end |