Class: Textus::Manifest::Entry::Base::PublishContext
- Inherits:
-
Data
- Object
- Data
- Textus::Manifest::Entry::Base::PublishContext
- Defined in:
- lib/textus/manifest/entry/base.rb
Overview
Minimal context object passed into entry ‘publish_via` hooks. Everything beyond the three primitives is derived. Data.define instances are frozen, so we recompute per-call rather than memoizing — RoleScope/Hooks::Context construction is cheap.
Instance Attribute Summary collapse
-
#call ⇒ Object
readonly
Returns the value of attribute call.
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
Instance Method Summary collapse
- #emit(event, **payload) ⇒ Object
- #events ⇒ Object
- #hook_context ⇒ Object
- #manifest ⇒ Object
- #repo_root ⇒ Object
- #root ⇒ Object
Instance Attribute Details
#call ⇒ Object (readonly)
Returns the value of attribute call
58 59 60 |
# File 'lib/textus/manifest/entry/base.rb', line 58 def call @call end |
#container ⇒ Object (readonly)
Returns the value of attribute container
58 59 60 |
# File 'lib/textus/manifest/entry/base.rb', line 58 def container @container end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader
58 59 60 |
# File 'lib/textus/manifest/entry/base.rb', line 58 def reader @reader end |
Instance Method Details
#emit(event, **payload) ⇒ Object
68 69 70 |
# File 'lib/textus/manifest/entry/base.rb', line 68 def emit(event, **payload) events.publish(event, ctx: hook_context, **payload) end |
#events ⇒ Object
62 |
# File 'lib/textus/manifest/entry/base.rb', line 62 def events = container.events |
#hook_context ⇒ Object
64 65 66 |
# File 'lib/textus/manifest/entry/base.rb', line 64 def hook_context Textus::Hooks::Context.new(scope: scope_for_hooks) end |
#manifest ⇒ Object
59 |
# File 'lib/textus/manifest/entry/base.rb', line 59 def manifest = container.manifest |
#repo_root ⇒ Object
61 |
# File 'lib/textus/manifest/entry/base.rb', line 61 def repo_root = File.dirname(container.root) |
#root ⇒ Object
60 |
# File 'lib/textus/manifest/entry/base.rb', line 60 def root = container.root |