Skip to content
Kward Search API index

Class: Kward::Transport::Host::Sessions

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

Overview

Resolves an external conversation to a normal Kward session.

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ Sessions

Returns a new instance of Sessions.



87
88
89
# File 'lib/kward/transport/host.rb', line 87

def initialize(host)
  @host = host
end

Instance Method Details

#resolve(conversation:, actor:, workspace_root: nil, name: nil) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/kward/transport/host.rb', line 91

def resolve(conversation:, actor:, workspace_root: nil, name: nil)
  workspace_root = fixed_workspace_root(workspace_root)
  @host.authorize!(:resolve_session, conversation: conversation, actor: actor, workspace_root: workspace_root)
  result = @host.gateway.resolve_transport_session(
    transport_id: @host.transport_id,
    conversation: conversation,
    actor: actor,
    workspace_root: workspace_root,
    name: name,
    execution_profile: @host.execution_profile
  )
  Session.new(@host, normalize_handle(result), actor)
end