Class: Meta::JsonSchema::DynamicSchemaBuilder
- Inherits:
-
Object
- Object
- Meta::JsonSchema::DynamicSchemaBuilder
- Defined in:
- lib/meta/json_schema/builders/dynamic_schema_builder.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ DynamicSchemaBuilder
constructor
A new instance of DynamicSchemaBuilder.
- #to_schema ⇒ Object
Constructor Details
#initialize(options) ⇒ DynamicSchemaBuilder
Returns a new instance of DynamicSchemaBuilder.
8 9 10 11 12 |
# File 'lib/meta/json_schema/builders/dynamic_schema_builder.rb', line 8 def initialize() = .dup @dynamic_schema_options = .delete(:dynamic_ref) @base_options = end |
Instance Method Details
#to_schema ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/meta/json_schema/builders/dynamic_schema_builder.rb', line 14 def to_schema DynamicSchema.new( @dynamic_schema_options[:resolve], one_of: @dynamic_schema_options[:one_of] && @dynamic_schema_options[:one_of].map { |schema| RefSchema.new(schema.to_schema) }, **@base_options ) end |