Class: ClaudeAgentSDK::SyncHookJSONOutput

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

Overview

Sync hook JSON output

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#[], #[]=, from_hash, wrap

Constructor Details

#initialize(attributes = {}) ⇒ SyncHookJSONOutput

Returns a new instance of SyncHookJSONOutput.



1200
1201
1202
1203
1204
# File 'lib/claude_agent_sdk/types.rb', line 1200

def initialize(attributes = {})
  super
  @continue = true if @continue.nil?
  @suppress_output = false if @suppress_output.nil?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ClaudeAgentSDK::Type

Instance Attribute Details

#continueObject

Returns the value of attribute continue.



1197
1198
1199
# File 'lib/claude_agent_sdk/types.rb', line 1197

def continue
  @continue
end

#decisionObject

Returns the value of attribute decision.



1197
1198
1199
# File 'lib/claude_agent_sdk/types.rb', line 1197

def decision
  @decision
end

#hook_specific_outputObject

Returns the value of attribute hook_specific_output.



1197
1198
1199
# File 'lib/claude_agent_sdk/types.rb', line 1197

def hook_specific_output
  @hook_specific_output
end

#reasonObject

Returns the value of attribute reason.



1197
1198
1199
# File 'lib/claude_agent_sdk/types.rb', line 1197

def reason
  @reason
end

#stop_reasonObject

Returns the value of attribute stop_reason.



1197
1198
1199
# File 'lib/claude_agent_sdk/types.rb', line 1197

def stop_reason
  @stop_reason
end

#suppress_outputObject

Returns the value of attribute suppress_output.



1197
1198
1199
# File 'lib/claude_agent_sdk/types.rb', line 1197

def suppress_output
  @suppress_output
end

#system_messageObject

Returns the value of attribute system_message.



1197
1198
1199
# File 'lib/claude_agent_sdk/types.rb', line 1197

def system_message
  @system_message
end

Instance Method Details

#to_hObject



1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
# File 'lib/claude_agent_sdk/types.rb', line 1206

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