Class: Events::WorkflowActivated

Inherits:
Object
  • Object
show all
Defined in:
lib/events/workflow_activated.rb

Overview

Emitted after Session#activate_workflow enqueues a workflow’s phantom pair. Subscribers rebroadcast the session’s active skills/workflow so the HUD reflects the new activation.

Constant Summary collapse

TYPE =
"workflow.activated"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_id:, workflow_name:) ⇒ WorkflowActivated

Returns a new instance of WorkflowActivated.

Parameters:

  • session_id (Integer)

    the session the workflow was activated on

  • workflow_name (String)

    canonical workflow name



14
15
16
17
# File 'lib/events/workflow_activated.rb', line 14

def initialize(session_id:, workflow_name:)
  @session_id = session_id
  @workflow_name = workflow_name
end

Instance Attribute Details

#session_idObject (readonly)

Returns the value of attribute session_id.



10
11
12
# File 'lib/events/workflow_activated.rb', line 10

def session_id
  @session_id
end

#workflow_nameObject (readonly)

Returns the value of attribute workflow_name.



10
11
12
# File 'lib/events/workflow_activated.rb', line 10

def workflow_name
  @workflow_name
end

Instance Method Details

#event_nameObject



19
20
21
# File 'lib/events/workflow_activated.rb', line 19

def event_name
  "#{Bus::NAMESPACE}.#{TYPE}"
end

#to_hObject



23
24
25
# File 'lib/events/workflow_activated.rb', line 23

def to_h
  {type: TYPE, session_id:, workflow_name:}
end