Sha256: b5f70a3906b35397f3bfcc86a5c2623eb7be3e42c2b0331adbb63b3e7657f187
Contents?: true
Size: 751 Bytes
Versions: 11
Compression:
Stored size: 751 Bytes
Contents
# frozen_string_literal: true require_relative 'collection_helpers' module EasyTalk module Builders # Base builder class for array-type properties. class UnionBuilder extend CollectionHelpers extend T::Sig sig { params(name: Symbol, type: T.untyped, constraints: T.untyped).void } def initialize(name, type, constraints) @name = name @type = type @constraints = constraints @context = {} end def build @context[@name] = { 'anyOf' => schemas } end def schemas types.map do |type| Property.new(@name, type, @constraints).build end end def types @type.types end end end end
Version data entries
11 entries across 11 versions & 1 rubygems