Type
Wraps custom type definitions.
Types can be objects (with shapes) or unions (with variants).
Example: Object type
api.types[:address].object? # => true
api.types[:address].shape[:city] # => Param for city fieldExample: Union type
api.types[:payment_method].union? # => true
api.types[:payment_method].variants # => [Param, ...]
api.types[:payment_method].discriminator # => :typeInstance Methods
#deprecated?
#deprecated?
Whether this type is deprecated.
Returns
Boolean
#description
#description
The description for this type.
Returns
String, nil
#discriminator
#discriminator
The discriminator for this type.
Returns
Symbol, nil
#example
#example
The example for this type.
Returns
Object, nil
#extends
#extends
The extends for this type.
Returns
Array<Symbol>
#extends?
#extends?
Whether this type extends other types.
Returns
Boolean
#object?
#object?
Whether this type is an object.
Returns
Boolean
#shape
#shape
The shape for this type.
Returns
Hash{Symbol => Param}
#to_h
#to_h
Converts this type to a hash.
Returns
Hash
#type
#type
The type for this type.
Returns
Symbol, nil
#union?
#union?
Whether this type is a union.
Returns
Boolean
#variants
#variants
The variants for this type.
Returns
Array<Param>