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.



59
60
61
# File 'lib/kward/plugin_registry.rb', line 59

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



66
67
68
# File 'lib/kward/plugin_registry.rb', line 66

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