Class: Meta::JsonSchema::ArraySchema
- Inherits:
-
BaseSchema
- Object
- BaseSchema
- Meta::JsonSchema::ArraySchema
- Defined in:
- lib/meta/json_schema/schemas/array_schema.rb
Constant Summary
Constants inherited from BaseSchema
BaseSchema::OPTIONS_CHECKER, BaseSchema::USER_OPTIONS_CHECKER
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Attributes inherited from BaseSchema
Instance Method Summary collapse
-
#initialize(items, options = {}) ⇒ ArraySchema
constructor
A new instance of ArraySchema.
- #to_schema_doc(**user_options) ⇒ Object
Methods inherited from BaseSchema
#filter, #filter?, #find_schema, #if?, #scoped, #staged, #to_schema, #value?
Constructor Details
#initialize(items, options = {}) ⇒ ArraySchema
Returns a new instance of ArraySchema.
8 9 10 11 12 |
# File 'lib/meta/json_schema/schemas/array_schema.rb', line 8 def initialize(items, = {}) super() @items = items end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
6 7 8 |
# File 'lib/meta/json_schema/schemas/array_schema.rb', line 6 def items @items end |
Instance Method Details
#to_schema_doc(**user_options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/meta/json_schema/schemas/array_schema.rb', line 14 def to_schema_doc(**) = schema = { type: 'array', items: @items ? @items.to_schema_doc(**) : {} } schema[:description] = [:description] if [:description] schema end |