Class: Meta::JsonSchema::ArraySchema
- Inherits:
-
BaseSchema
- Object
- BaseSchema
- Meta::JsonSchema::ArraySchema
- Extended by:
- Forwardable
- Defined in:
- lib/meta/json_schema/schemas/array_schema.rb
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
#defined_scopes, #filter, #filter?, #find_schema, #if?, #scoped, #staged, #to_schema, #value?
Constructor Details
#initialize(items, options = {}) ⇒ ArraySchema
Returns a new instance of ArraySchema.
10 11 12 13 14 |
# File 'lib/meta/json_schema/schemas/array_schema.rb', line 10 def initialize(items, = {}) super() @items = items end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
8 9 10 |
# File 'lib/meta/json_schema/schemas/array_schema.rb', line 8 def items @items end |
Instance Method Details
#to_schema_doc(**user_options) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/meta/json_schema/schemas/array_schema.rb', line 16 def to_schema_doc(**) = schema = { type: 'array', items: @items ? @items.to_schema_doc(**) : {} } schema[:description] = [:description] if [:description] schema end |