Class: MicroMcp::Schema::SchemaBuilder
- Inherits:
-
Object
- Object
- MicroMcp::Schema::SchemaBuilder
show all
- Defined in:
- lib/micro_mcp/schema.rb
Overview
Schema builder class for chaining
Instance Method Summary
collapse
Constructor Details
Returns a new instance of SchemaBuilder.
7
8
9
|
# File 'lib/micro_mcp/schema.rb', line 7
def initialize(schema)
@schema = schema
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/micro_mcp/schema.rb', line 19
def method_missing(method, *args)
if @schema.respond_to?(method)
@schema.send(method, *args)
else
super
end
end
|
Instance Method Details
#optional ⇒ Object
15
16
17
|
# File 'lib/micro_mcp/schema.rb', line 15
def optional
@schema
end
|
#required ⇒ Object
11
12
13
|
# File 'lib/micro_mcp/schema.rb', line 11
def required
@schema.merge(required: true)
end
|
#respond_to_missing?(method, include_private = false) ⇒ Boolean
27
28
29
|
# File 'lib/micro_mcp/schema.rb', line 27
def respond_to_missing?(method, include_private = false)
@schema.respond_to?(method) || super
end
|