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



52
53
54
# File 'lib/textus/manifest/entry/base.rb', line 52

def call
  @call
end

#containerObject (readonly)

Returns the value of attribute container

Returns:

  • (Object)

    the current value of container



52
53
54
# File 'lib/textus/manifest/entry/base.rb', line 52

def container
  @container
end

#readerObject (readonly)

Returns the value of attribute reader

Returns:

  • (Object)

    the current value of reader



52
53
54
# File 'lib/textus/manifest/entry/base.rb', line 52

def reader
  @reader
end

Instance Method Details

#emit(event, **payload) ⇒ Object



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

def emit(event, **payload)
  events.publish(event, ctx: hook_context, **payload)
end

#eventsObject



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

def events     = container.events

#hook_contextObject



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

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

#manifestObject



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

def manifest   = container.manifest

#repo_rootObject



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

def repo_root  = File.dirname(container.root)

#rootObject



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

def root       = container.root