Class: Dry::Doc::Schema
- Inherits:
-
Object
- Object
- Dry::Doc::Schema
- Defined in:
- lib/dry/doc/schema.rb
Defined Under Namespace
Classes: Field
Constant Summary collapse
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(klass) ⇒ Schema
constructor
A new instance of Schema.
- #register(name, type, description:) ⇒ Object
Constructor Details
#initialize(klass) ⇒ Schema
Returns a new instance of Schema.
100 101 102 |
# File 'lib/dry/doc/schema.rb', line 100 def initialize klass @klass, @properties = klass, {} end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
98 99 100 |
# File 'lib/dry/doc/schema.rb', line 98 def klass @klass end |
Instance Method Details
#as_json ⇒ Object
110 111 112 113 114 115 |
# File 'lib/dry/doc/schema.rb', line 110 def as_json { type: :object, properties: @properties.transform_values(&:as_json) } end |