Class: Textus::Manifest::Entry::Base::PublishContext

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#callObject (readonly)

Returns the value of attribute call

Returns:

  • (Object)

    the current value of call



58
59
60
# File 'lib/textus/manifest/entry/base.rb', line 58

def call
  @call
end

#containerObject (readonly)

Returns the value of attribute container

Returns:

  • (Object)

    the current value of container



58
59
60
# File 'lib/textus/manifest/entry/base.rb', line 58

def container
  @container
end

#readerObject (readonly)

Returns the value of attribute reader

Returns:

  • (Object)

    the current value of 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

#eventsObject



62
# File 'lib/textus/manifest/entry/base.rb', line 62

def events     = container.events

#hook_contextObject



64
65
66
# File 'lib/textus/manifest/entry/base.rb', line 64

def hook_context
  Textus::Hooks::Context.new(scope: scope_for_hooks)
end

#manifestObject



59
# File 'lib/textus/manifest/entry/base.rb', line 59

def manifest   = container.manifest

#repo_rootObject



61
# File 'lib/textus/manifest/entry/base.rb', line 61

def repo_root  = File.dirname(container.root)

#rootObject



60
# File 'lib/textus/manifest/entry/base.rb', line 60

def root       = container.root