Class: Babl::Schema::AnyOf
- Inherits:
-
Object
- Object
- Babl::Schema::AnyOf
- Defined in:
- lib/babl/schema/any_of.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(choices) ⇒ AnyOf
constructor
A new instance of AnyOf.
- #json ⇒ Object
-
#simplify ⇒ Object
Perform simple transformations in order to reduce the size of the generated schema.
Constructor Details
Class Method Details
.canonicalized(choices) ⇒ Object
34 35 36 |
# File 'lib/babl/schema/any_of.rb', line 34 def self.canonicalized(choices) new(choices).simplify end |
Instance Method Details
#json ⇒ Object
14 15 16 |
# File 'lib/babl/schema/any_of.rb', line 14 def json json_only_primitives || json_coalesced_types || json_general_case end |
#simplify ⇒ Object
Perform simple transformations in order to reduce the size of the generated schema.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/babl/schema/any_of.rb', line 20 def simplify simplify_single || simplify_anything || simplify_boolean || simplify_typed_and_static || simplify_empty_array || simplify_push_down_dyn_array || simplify_dyn_and_fixed_array || simplify_merge_objects || simplify_integer_is_number || simplify_many_fixed_arrays || self end |