Class: JsonModel::Types::AnyOf
- Inherits:
-
Dry::Types::Constructor
- Object
- Dry::Types::Constructor
- JsonModel::Types::AnyOf
- Defined in:
- lib/json_model/types/any_of.rb
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#mapping ⇒ Object
readonly
Returns the value of attribute mapping.
-
#tag_key ⇒ Object
readonly
Returns the value of attribute tag_key.
Instance Method Summary collapse
Instance Attribute Details
#mapping ⇒ Object (readonly)
Returns the value of attribute mapping.
16 17 18 |
# File 'lib/json_model/types/any_of.rb', line 16 def mapping @mapping end |
#tag_key ⇒ Object (readonly)
Returns the value of attribute tag_key.
16 17 18 |
# File 'lib/json_model/types/any_of.rb', line 16 def tag_key @tag_key end |
Instance Method Details
#to_ast ⇒ Array
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/json_model/types/any_of.rb', line 19 def to_ast [ :any_of, { tag_key: [:tag_key], mapping: [:mapping].transform_values do |type| type.respond_to?(:to_ast) ? type.to_ast : type.class.name end, meta: , }, ] end |