Class: JSON::SchemaBuilder::Array
- Defined in:
- lib/json/schema_builder/array.rb
Instance Attribute Summary
Attributes inherited from Entity
#children, #error, #fragment, #fragments, #name, #options, #parent
Instance Method Summary collapse
Methods inherited from Entity
#add_fragment, #as_json, disable_attributes!, #extend, #initialize, #initialized?, #inspect, #merge_children!, #method_missing, #reinitialize, #required, #required=, #reset_fragment, #respond_to?, #schema
Methods included from Helpers
#empty_string, #id, #object_or_array
Methods included from Validation
#fully_validate, #validate, #validate!
Methods included from DSL
Constructor Details
This class inherits a constructor from JSON::SchemaBuilder::Entity
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class JSON::SchemaBuilder::Entity
Instance Method Details
#items(*args, &block) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/json/schema_builder/array.rb', line 12 def items(*args, &block) opts = args. schema[:items] = args.first schema[:items] ||= items_entity(opts, &block).as_json parent.reinitialize if parent end |