Class: ClaudeCode::ClaudeCodeOptions
- Inherits:
-
Object
- Object
- ClaudeCode::ClaudeCodeOptions
- Defined in:
- lib/claude_code/types.rb
Overview
Query options
Instance Attribute Summary collapse
-
#allowed_tools ⇒ Object
readonly
Returns the value of attribute allowed_tools.
-
#append_system_prompt ⇒ Object
readonly
Returns the value of attribute append_system_prompt.
-
#continue_conversation ⇒ Object
readonly
Returns the value of attribute continue_conversation.
-
#cwd ⇒ Object
readonly
Returns the value of attribute cwd.
-
#disallowed_tools ⇒ Object
readonly
Returns the value of attribute disallowed_tools.
-
#input_format ⇒ Object
readonly
Returns the value of attribute input_format.
-
#max_thinking_tokens ⇒ Object
readonly
Returns the value of attribute max_thinking_tokens.
-
#max_turns ⇒ Object
readonly
Returns the value of attribute max_turns.
-
#mcp_servers ⇒ Object
readonly
Returns the value of attribute mcp_servers.
-
#mcp_tools ⇒ Object
readonly
Returns the value of attribute mcp_tools.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#output_format ⇒ Object
readonly
Returns the value of attribute output_format.
-
#permission_mode ⇒ Object
readonly
Returns the value of attribute permission_mode.
-
#permission_prompt_tool_name ⇒ Object
readonly
Returns the value of attribute permission_prompt_tool_name.
-
#resume ⇒ Object
readonly
Returns the value of attribute resume.
-
#resume_conversation_id ⇒ Object
readonly
Returns the value of attribute resume_conversation_id.
-
#system_prompt ⇒ Object
readonly
Returns the value of attribute system_prompt.
Instance Method Summary collapse
-
#initialize(allowed_tools: [], max_thinking_tokens: 8000, system_prompt: nil, append_system_prompt: nil, mcp_tools: [], mcp_servers: {}, permission_mode: nil, continue_conversation: false, resume: nil, resume_conversation_id: nil, max_turns: nil, disallowed_tools: [], model: nil, permission_prompt_tool_name: nil, cwd: nil, input_format: nil, output_format: nil) ⇒ ClaudeCodeOptions
constructor
A new instance of ClaudeCodeOptions.
- #to_h ⇒ Object
Constructor Details
#initialize(allowed_tools: [], max_thinking_tokens: 8000, system_prompt: nil, append_system_prompt: nil, mcp_tools: [], mcp_servers: {}, permission_mode: nil, continue_conversation: false, resume: nil, resume_conversation_id: nil, max_turns: nil, disallowed_tools: [], model: nil, permission_prompt_tool_name: nil, cwd: nil, input_format: nil, output_format: nil) ⇒ ClaudeCodeOptions
Returns a new instance of ClaudeCodeOptions.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/claude_code/types.rb', line 177 def initialize( allowed_tools: [], max_thinking_tokens: 8000, system_prompt: nil, append_system_prompt: nil, mcp_tools: [], mcp_servers: {}, permission_mode: nil, continue_conversation: false, resume: nil, resume_conversation_id: nil, max_turns: nil, disallowed_tools: [], model: nil, permission_prompt_tool_name: nil, cwd: nil, input_format: nil, output_format: nil ) @allowed_tools = allowed_tools @max_thinking_tokens = max_thinking_tokens @system_prompt = system_prompt @append_system_prompt = append_system_prompt @mcp_tools = mcp_tools @mcp_servers = mcp_servers @permission_mode = @continue_conversation = continue_conversation @resume = resume @resume_conversation_id = resume_conversation_id @max_turns = max_turns @disallowed_tools = disallowed_tools @model = model @permission_prompt_tool_name = @cwd = cwd @input_format = input_format @output_format = output_format end |
Instance Attribute Details
#allowed_tools ⇒ Object (readonly)
Returns the value of attribute allowed_tools.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def allowed_tools @allowed_tools end |
#append_system_prompt ⇒ Object (readonly)
Returns the value of attribute append_system_prompt.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def append_system_prompt @append_system_prompt end |
#continue_conversation ⇒ Object (readonly)
Returns the value of attribute continue_conversation.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def continue_conversation @continue_conversation end |
#cwd ⇒ Object (readonly)
Returns the value of attribute cwd.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def cwd @cwd end |
#disallowed_tools ⇒ Object (readonly)
Returns the value of attribute disallowed_tools.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def disallowed_tools @disallowed_tools end |
#input_format ⇒ Object (readonly)
Returns the value of attribute input_format.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def input_format @input_format end |
#max_thinking_tokens ⇒ Object (readonly)
Returns the value of attribute max_thinking_tokens.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def max_thinking_tokens @max_thinking_tokens end |
#max_turns ⇒ Object (readonly)
Returns the value of attribute max_turns.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def max_turns @max_turns end |
#mcp_servers ⇒ Object (readonly)
Returns the value of attribute mcp_servers.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def mcp_servers @mcp_servers end |
#mcp_tools ⇒ Object (readonly)
Returns the value of attribute mcp_tools.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def mcp_tools @mcp_tools end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def model @model end |
#output_format ⇒ Object (readonly)
Returns the value of attribute output_format.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def output_format @output_format end |
#permission_mode ⇒ Object (readonly)
Returns the value of attribute permission_mode.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def @permission_mode end |
#permission_prompt_tool_name ⇒ Object (readonly)
Returns the value of attribute permission_prompt_tool_name.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def @permission_prompt_tool_name end |
#resume ⇒ Object (readonly)
Returns the value of attribute resume.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def resume @resume end |
#resume_conversation_id ⇒ Object (readonly)
Returns the value of attribute resume_conversation_id.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def resume_conversation_id @resume_conversation_id end |
#system_prompt ⇒ Object (readonly)
Returns the value of attribute system_prompt.
172 173 174 |
# File 'lib/claude_code/types.rb', line 172 def system_prompt @system_prompt end |
Instance Method Details
#to_h ⇒ Object
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/claude_code/types.rb', line 215 def to_h { allowed_tools: @allowed_tools, max_thinking_tokens: @max_thinking_tokens, system_prompt: @system_prompt, append_system_prompt: @append_system_prompt, mcp_tools: @mcp_tools, mcp_servers: @mcp_servers.transform_values { |config| config.respond_to?(:to_h) ? config.to_h : config }, permission_mode: @permission_mode, continue_conversation: @continue_conversation, resume: @resume, resume_conversation_id: @resume_conversation_id, max_turns: @max_turns, disallowed_tools: @disallowed_tools, model: @model, permission_prompt_tool_name: @permission_prompt_tool_name, cwd: @cwd&.to_s, input_format: @input_format, output_format: @output_format }.compact end |