Sha256: 317dadfecfb8fcaa605edb04ef77256817b51196b013956c52fc02d59d52bccc
Contents?: true
Size: 1.18 KB
Versions: 26
Compression:
Stored size: 1.18 KB
Contents
module Foobara module BuiltinTypes module Duck module SupportedValidators class OneOf < TypeDeclarations::Validator module TypeDeclarationExtension module ExtendRegisteredTypeDeclaration module Desugarizers class ModuleDesugarizer < TypeDeclarations::Desugarizer def applicable?(rawish_type_declaration) rawish_type_declaration.is_a?(::Hash) && rawish_type_declaration[:one_of].is_a?(::Module) end def desugarize(rawish_type_declaration) mod = rawish_type_declaration[:one_of] one_of = Util.constant_values(mod) one_of = begin one_of.sort rescue # :nocov: one_of.sort_by(&:inspect) # :nocov: end rawish_type_declaration.merge(one_of:) end def priority Priority::LOW end end end end end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems