Class: Textus::Step::Observe

Inherits:
Base
  • Object
show all
Defined in:
lib/textus/step/observe.rb

Overview

Reacts to a lifecycle event (Catalog::PUBSUB). 0..N per event, fire-and-forget, no meaningful return, timeout-isolated by the EventBus. Declares its event with ‘on :event_name` and an optional key filter with `match “glob.**”`. Replaces user pub/sub subscribers.

Class Attribute Summary collapse

Attributes inherited from Base

#name

Class Method Summary collapse

Methods inherited from Base

kind, required_kwargs, step_name

Class Attribute Details

.eventObject (readonly)

Returns the value of attribute event.



27
28
29
# File 'lib/textus/step/observe.rb', line 27

def event
  @event
end

Class Method Details

.match(glob = :__read__) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/textus/step/observe.rb', line 18

def self.match(glob = :__read__)
  if glob == :__read__
    @match
  else
    @match = glob
  end
end

.on(event = :__read__) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/textus/step/observe.rb', line 10

def self.on(event = :__read__)
  if event == :__read__
    @event
  else
    @event = event.to_sym
  end
end