Class: Keiyaku::OneOf
- Inherits:
-
Object
- Object
- Keiyaku::OneOf
- Defined in:
- lib/keiyaku/runtime.rb,
sig/keiyaku.rbs
Overview
A union with a discriminator: into: OneOf[Dog, Cat, on: "petType"]
Class Method Summary collapse
Instance Method Summary collapse
- #cast(value, path = "value") ⇒ Object
-
#initialize(variants, discriminator, map) ⇒ OneOf
constructor
A new instance of OneOf.
Constructor Details
#initialize(variants, discriminator, map) ⇒ OneOf
Returns a new instance of OneOf.
107 |
# File 'sig/keiyaku.rbs', line 107
def initialize: (Array[untyped], String, Hash[untyped, untyped]) -> void
|
Class Method Details
.[](*variants, on:, map: {}) ⇒ OneOf
106 |
# File 'sig/keiyaku.rbs', line 106
def self.[]: (*untyped variants, on: String, ?map: Hash[untyped, untyped]) -> OneOf
|
Instance Method Details
#cast(value, path = "value") ⇒ Object
108 |
# File 'sig/keiyaku.rbs', line 108
def cast: (untyped, ?String) -> untyped
|