Class: Meta::JsonSchema::ArraySchemaBuilder
- Inherits:
-
Object
- Object
- Meta::JsonSchema::ArraySchemaBuilder
- Defined in:
- lib/meta/json_schema/builders/array_schema_builder.rb
Instance Method Summary collapse
-
#initialize(options, &block) ⇒ ArraySchemaBuilder
constructor
A new instance of ArraySchemaBuilder.
- #object_property?(options, block) ⇒ Boolean
- #to_schema ⇒ Object
Constructor Details
#initialize(options, &block) ⇒ ArraySchemaBuilder
Returns a new instance of ArraySchemaBuilder.
6 7 8 9 10 11 12 13 14 |
# File 'lib/meta/json_schema/builders/array_schema_builder.rb', line 6 def initialize(, &block) = .dup = .delete(:items) || {} [:ref] = .delete(:ref) if [:ref] [:dynamic_ref] = .delete(:dynamic_ref) if [:dynamic_ref] @items_schema = SchemaBuilderTool.build(, &block) @base_options = end |
Instance Method Details
#object_property?(options, block) ⇒ Boolean
20 21 22 |
# File 'lib/meta/json_schema/builders/array_schema_builder.rb', line 20 def object_property?(, block) ( && ![:properties].nil?) || !block.nil? end |
#to_schema ⇒ Object
16 17 18 |
# File 'lib/meta/json_schema/builders/array_schema_builder.rb', line 16 def to_schema ArraySchema.new(@items_schema, @base_options) end |