Class: PromptSchema::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/prompt_schema/schema.rb

Overview

Represents a Dry::Schema schema, providing methods to access its properties and to generate prompts based on the schema.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dry_schema) ⇒ Schema

Returns a new instance of Schema.



9
10
11
# File 'lib/prompt_schema/schema.rb', line 9

def initialize(dry_schema)
  @dry_schema = dry_schema
end

Instance Attribute Details

#dry_schemaObject (readonly)

Returns the value of attribute dry_schema.



7
8
9
# File 'lib/prompt_schema/schema.rb', line 7

def dry_schema
  @dry_schema
end

Instance Method Details

#[]Object



13
# File 'lib/prompt_schema/schema.rb', line 13

def [](...) = @dry_schema.[](...)

#callObject



14
# File 'lib/prompt_schema/schema.rb', line 14

def call(...) = @dry_schema.call(...)

#promptObject



16
17
18
# File 'lib/prompt_schema/schema.rb', line 16

def prompt
  Prompt.call(@dry_schema)
end