Class: PromptSchema::Schema
- Inherits:
-
Object
- Object
- PromptSchema::Schema
- 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
-
#dry_schema ⇒ Object
readonly
Returns the value of attribute dry_schema.
Instance Method Summary collapse
- #[] ⇒ Object
- #call ⇒ Object
-
#initialize(dry_schema) ⇒ Schema
constructor
A new instance of Schema.
- #prompt ⇒ Object
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_schema ⇒ Object (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.[](...) |
#call ⇒ Object
14 |
# File 'lib/prompt_schema/schema.rb', line 14 def call(...) = @dry_schema.call(...) |
#prompt ⇒ Object
16 17 18 |
# File 'lib/prompt_schema/schema.rb', line 16 def prompt Prompt.call(@dry_schema) end |