Class: ClaudeAgentSDK::PermissionUpdate

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

Overview

Permission update configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

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

Constructor Details

This class inherits a constructor from ClaudeAgentSDK::Type

Dynamic Method Handling

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

Instance Attribute Details

#behaviorObject

Returns the value of attribute behavior.



494
495
496
# File 'lib/claude_agent_sdk/types.rb', line 494

def behavior
  @behavior
end

#destinationObject

Returns the value of attribute destination.



494
495
496
# File 'lib/claude_agent_sdk/types.rb', line 494

def destination
  @destination
end

#directoriesObject

Returns the value of attribute directories.



494
495
496
# File 'lib/claude_agent_sdk/types.rb', line 494

def directories
  @directories
end

#modeObject

Returns the value of attribute mode.



494
495
496
# File 'lib/claude_agent_sdk/types.rb', line 494

def mode
  @mode
end

#rulesObject

Returns the value of attribute rules.



494
495
496
# File 'lib/claude_agent_sdk/types.rb', line 494

def rules
  @rules
end

#typeObject

Returns the value of attribute type.



494
495
496
# File 'lib/claude_agent_sdk/types.rb', line 494

def type
  @type
end

Instance Method Details

#to_hObject



496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/claude_agent_sdk/types.rb', line 496

def to_h
  result = { type: @type }
  result[:destination] = @destination if @destination

  case @type
  when 'addRules', 'replaceRules', 'removeRules'
    if @rules
      result[:rules] = @rules.map do |rule|
        {
          toolName: rule.tool_name,
          ruleContent: rule.rule_content
        }
      end
    end
    result[:behavior] = @behavior if @behavior
  when 'setMode'
    result[:mode] = @mode if @mode
  when 'addDirectories', 'removeDirectories'
    result[:directories] = @directories if @directories
  end

  result
end