Skip to content
Kward Search API index

Class: Kward::PluginRegistry::Transcript

Inherits:
Object
  • Object
show all
Defined in:
lib/kward/plugin_registry.rb

Overview

Read-only transcript view exposed to plugin code.

Instance Method Summary collapse

Constructor Details

#initialize(conversation) ⇒ Transcript

Creates an object for trusted plugin loading and dispatch.



50
51
52
# File 'lib/kward/plugin_registry.rb', line 50

def initialize(conversation)
  @conversation = conversation
end

Instance Method Details

#messagesArray<Hash>

Returns a deep-frozen copy of the active conversation messages.

Returns:

  • (Array<Hash>)

    immutable transcript message data



57
58
59
# File 'lib/kward/plugin_registry.rb', line 57

def messages
  DeepCopy.freeze(DeepCopy.dup(@conversation.messages))
end