Class: ClaudeAgentSDK::SystemPromptCustom

Inherits:
Type
  • Object
show all
Includes:
Type::OptionValue
Defined in:
lib/claude_agent_sdk/types/option_values.rb,
sig/claude_agent_sdk/types/option_values.rbs

Overview

The object form of a String system prompt, so snapshot can be set.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Type::OptionValue

#dup_for_options

Methods inherited from Type

#[], #[]=, attr_accessor, attr_reader, attr_writer, attribute?, attribute_method?, attribute_names, cache_attribute_reader, cache_attribute_writer, cached_attribute_reader, cached_attribute_writer, declare_attributes, deep_dup_for_options, #dup_for_options, from_hash, #inspect, inspect_filtered, inspect_filtered_attributes, strict_attributes, strict_attributes?, #to_s, wrap

Constructor Details

#initialize(prompt:, snapshot:) ⇒ void #initialize(attributes) ⇒ void

Returns a new instance of SystemPromptCustom.

Overloads:

  • #initialize(prompt:, snapshot:) ⇒ void

    Parameters:

    • prompt: (String, nil)
    • snapshot: (Boolean, nil)
  • #initialize(attributes) ⇒ void

    Parameters:

    • attributes (Hash[Symbol | String, untyped], nil)


272
273
274
275
# File 'lib/claude_agent_sdk/types/option_values.rb', line 272

def initialize(attributes = {})
  super
  @type = 'custom'
end

Dynamic Method Handling

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

Instance Attribute Details

#prompt ⇒ String?

Returns the value of attribute prompt.

Returns:

  • (String, nil)


270
271
272
# File 'lib/claude_agent_sdk/types/option_values.rb', line 270

def prompt
  @prompt
end

#snapshot ⇒ Boolean?

Returns the value of attribute snapshot.

Returns:

  • (Boolean, nil)


270
271
272
# File 'lib/claude_agent_sdk/types/option_values.rb', line 270

def snapshot
  @snapshot
end

#type ⇒ String (readonly)

"custom".

Returns:

  • (String)


223
224
225
# File 'sig/claude_agent_sdk/types/option_values.rbs', line 223

def type
  @type
end

Instance Method Details

#to_h ⇒ Hash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


277
278
279
280
281
# File 'lib/claude_agent_sdk/types/option_values.rb', line 277

def to_h
  result = { type: @type, prompt: @prompt }
  result[:snapshot] = @snapshot unless @snapshot.nil?
  result
end