Class: SoberSwag::Nodes::Sum
- Defined in:
- lib/sober_swag/nodes/sum.rb
Overview
A "Sum" type represents either one type or the other.
It is called "Sum" because, if a type can be either type A
or type B
,
the number of possible values for the type of number_of_values(A) + number_of_values(B)
.
Internally, this is primarily used when an object can be either one type or another. It will latter be flattened into OneOf
Instance Attribute Summary
Attributes inherited from Binary
Method Summary
Methods inherited from Binary
#cata, #deconstruct, #deconstruct_keys, #initialize, #map
Methods inherited from Base
#<=>, #cata, #eql?, #hash, #map
Constructor Details
This class inherits a constructor from SoberSwag::Nodes::Binary