Class: Parabot::Messaging::DryRunAdapter

Inherits:
Adapter
  • Object
show all
Includes:
DryRunLogging
Defined in:
lib/parabot/messaging/dry_run_adapter.rb

Overview

Dry-run implementation of the MessagingAdapter that logs actions without executing them

Instance Method Summary collapse

Constructor Details

#initialize(dry_run: true, **_kwargs) ⇒ DryRunAdapter

Returns a new instance of DryRunAdapter.



12
13
14
# File 'lib/parabot/messaging/dry_run_adapter.rb', line 12

def initialize(dry_run: true, **_kwargs)
  @dry_run = dry_run
end

Instance Method Details

#abortBoolean

Returns always true (simulated success).

Returns:

  • (Boolean)

    always true (simulated success)



43
44
45
46
# File 'lib/parabot/messaging/dry_run_adapter.rb', line 43

def abort
  dry_run_log "Would send abort command (ESC key) to Claude"
  true
end

#end_sessionBoolean

Returns always true (simulated success).

Returns:

  • (Boolean)

    always true (simulated success)



37
38
39
40
# File 'lib/parabot/messaging/dry_run_adapter.rb', line 37

def end_session
  dry_run_log "Would end Claude session"
  true
end

#send_message(message) ⇒ Boolean

Returns always true (simulated success).

Parameters:

  • message (String)

    the message to send to Claude

Returns:

  • (Boolean)

    always true (simulated success)



18
19
20
21
22
# File 'lib/parabot/messaging/dry_run_adapter.rb', line 18

def send_message(message)
  dry_run_log "Would send message to Claude:"
  puts message
  true
end

#session_active?Boolean

Returns always true (simulated active session).

Returns:

  • (Boolean)

    always true (simulated active session)



49
50
51
52
# File 'lib/parabot/messaging/dry_run_adapter.rb', line 49

def session_active?
  dry_run_log "Would check if Claude session is active"
  true
end

#start_session(system_prompt: nil) ⇒ Boolean

Returns always true (simulated success).

Parameters:

  • system_prompt (String, nil) (defaults to: nil)

    optional system prompt

Returns:

  • (Boolean)

    always true (simulated success)



26
27
28
29
30
31
32
33
34
# File 'lib/parabot/messaging/dry_run_adapter.rb', line 26

def start_session(system_prompt: nil)
  dry_run_log "Would start Claude session"
  if system_prompt
    dry_run_log "Would use system prompt: #{system_prompt[0..100]}#{'...' if system_prompt.length > 100}"
  else
    dry_run_log "Would start without system prompt"
  end
  true
end