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
47 48 49 |
# File 'lib/textus/manifest/entry/base.rb', line 47 def call @call end |
#container ⇒ Object (readonly)
Returns the value of attribute container
47 48 49 |
# File 'lib/textus/manifest/entry/base.rb', line 47 def container @container end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader
47 48 49 |
# File 'lib/textus/manifest/entry/base.rb', line 47 def reader @reader end |
Instance Method Details
#emit(event, **payload) ⇒ Object
57 58 59 |
# File 'lib/textus/manifest/entry/base.rb', line 57 def emit(event, **payload) events.publish(event, ctx: hook_context, **payload) end |
#events ⇒ Object
51 |
# File 'lib/textus/manifest/entry/base.rb', line 51 def events = container.events |
#hook_context ⇒ Object
53 54 55 |
# File 'lib/textus/manifest/entry/base.rb', line 53 def hook_context Textus::Hooks::Context.new(scope: scope_for_hooks) end |
#manifest ⇒ Object
48 |
# File 'lib/textus/manifest/entry/base.rb', line 48 def manifest = container.manifest |
#repo_root ⇒ Object
50 |
# File 'lib/textus/manifest/entry/base.rb', line 50 def repo_root = File.dirname(container.root) |
#root ⇒ Object
49 |
# File 'lib/textus/manifest/entry/base.rb', line 49 def root = container.root |