Class: ClaudeAgentSDK::SyncHookJSONOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_agent_sdk/types.rb

Overview

Sync hook JSON output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(continue: true, suppress_output: false, stop_reason: nil, decision: nil, system_message: nil, reason: nil, hook_specific_output: nil) ⇒ SyncHookJSONOutput

Returns a new instance of SyncHookJSONOutput.



1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
# File 'lib/claude_agent_sdk/types.rb', line 1366

def initialize(continue: true, suppress_output: false, stop_reason: nil, decision: nil,
               system_message: nil, reason: nil, hook_specific_output: nil)
  @continue = continue
  @suppress_output = suppress_output
  @stop_reason = stop_reason
  @decision = decision
  @system_message = system_message
  @reason = reason
  @hook_specific_output = hook_specific_output
end

Instance Attribute Details

#continueObject

Returns the value of attribute continue.



1363
1364
1365
# File 'lib/claude_agent_sdk/types.rb', line 1363

def continue
  @continue
end

#decisionObject

Returns the value of attribute decision.



1363
1364
1365
# File 'lib/claude_agent_sdk/types.rb', line 1363

def decision
  @decision
end

#hook_specific_outputObject

Returns the value of attribute hook_specific_output.



1363
1364
1365
# File 'lib/claude_agent_sdk/types.rb', line 1363

def hook_specific_output
  @hook_specific_output
end

#reasonObject

Returns the value of attribute reason.



1363
1364
1365
# File 'lib/claude_agent_sdk/types.rb', line 1363

def reason
  @reason
end

#stop_reasonObject

Returns the value of attribute stop_reason.



1363
1364
1365
# File 'lib/claude_agent_sdk/types.rb', line 1363

def stop_reason
  @stop_reason
end

#suppress_outputObject

Returns the value of attribute suppress_output.



1363
1364
1365
# File 'lib/claude_agent_sdk/types.rb', line 1363

def suppress_output
  @suppress_output
end

#system_messageObject

Returns the value of attribute system_message.



1363
1364
1365
# File 'lib/claude_agent_sdk/types.rb', line 1363

def system_message
  @system_message
end

Instance Method Details

#to_hObject



1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
# File 'lib/claude_agent_sdk/types.rb', line 1377

def to_h
  result = { continue: @continue }
  result[:suppressOutput] = @suppress_output if @suppress_output
  result[:stopReason] = @stop_reason if @stop_reason
  result[:decision] = @decision if @decision
  result[:systemMessage] = @system_message if @system_message
  result[:reason] = @reason if @reason
  result[:hookSpecificOutput] = @hook_specific_output.to_h if @hook_specific_output
  result
end