Class: ClaudeAgentSDK::PreToolUseHookSpecificOutput

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

Overview

PreToolUse hook specific output

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

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

Constructor Details

#initialize(attributes = {}) ⇒ PreToolUseHookSpecificOutput

Returns a new instance of PreToolUseHookSpecificOutput.



873
874
875
876
# File 'lib/claude_agent_sdk/types.rb', line 873

def initialize(attributes = {})
  super
  @hook_event_name = 'PreToolUse'
end

Dynamic Method Handling

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

Instance Attribute Details

#additional_contextObject

Returns the value of attribute additional_context.



869
870
871
# File 'lib/claude_agent_sdk/types.rb', line 869

def additional_context
  @additional_context
end

#hook_event_nameObject (readonly)

Returns the value of attribute hook_event_name.



871
872
873
# File 'lib/claude_agent_sdk/types.rb', line 871

def hook_event_name
  @hook_event_name
end

#permission_decisionObject

Returns the value of attribute permission_decision.



869
870
871
# File 'lib/claude_agent_sdk/types.rb', line 869

def permission_decision
  @permission_decision
end

#permission_decision_reasonObject

Returns the value of attribute permission_decision_reason.



869
870
871
# File 'lib/claude_agent_sdk/types.rb', line 869

def permission_decision_reason
  @permission_decision_reason
end

#updated_inputObject

Returns the value of attribute updated_input.



869
870
871
# File 'lib/claude_agent_sdk/types.rb', line 869

def updated_input
  @updated_input
end

Instance Method Details

#to_hObject



878
879
880
881
882
883
884
885
# File 'lib/claude_agent_sdk/types.rb', line 878

def to_h
  result = { hookEventName: @hook_event_name }
  result[:permissionDecision] = @permission_decision if @permission_decision
  result[:permissionDecisionReason] = @permission_decision_reason if @permission_decision_reason
  result[:updatedInput] = @updated_input if @updated_input
  result[:additionalContext] = @additional_context if @additional_context
  result
end