Sha256: 797f03c28dcb7f3adee9fcca4cfe239a61860e57d1fcb73116d3bd54cc22f5a0
Contents?: true
Size: 1.04 KB
Versions: 26
Compression:
Stored size: 1.04 KB
Contents
module Foobara module TypeDeclarations module Handlers class ExtendRegisteredModelTypeDeclaration < ExtendRegisteredTypeDeclaration class HashDesugarizer < TypeDeclarations::Desugarizer def applicable?(sugary_type_declaration) return false unless sugary_type_declaration.is_a?(::Hash) type_symbol = sugary_type_declaration[:type] if type_symbol if type_symbol.is_a?(::Symbol) && type_registered?(type_symbol) type = Foobara.foobara_root_namespace.foobara_lookup_type( type_symbol, mode: Namespace::LookupMode::ABSOLUTE ) type&.extends?(BuiltinTypes[expected_type_symbol]) end end end def expected_type_symbol :model end def desugarize(sugary_type_declaration) Util.symbolize_keys(sugary_type_declaration) end def priority Priority::HIGH end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems