Sha256: d92ac379d5da11bd725698d1850883826445ea9f584d6f2f1e44621089187e3f
Contents?: true
Size: 895 Bytes
Versions: 26
Compression:
Stored size: 895 Bytes
Contents
module Foobara module TypeDeclarations module Handlers # Why doesn't this inherit from ExtendModelTypeDeclaration class ExtendRegisteredModelTypeDeclaration < ExtendRegisteredTypeDeclaration def applicable?(sugary_type_declaration) strict_type_declaration = desugarize(sugary_type_declaration) if strict_type_declaration.is_a?(::Hash) && strict_type_declaration.key?(:type) type_symbol = strict_type_declaration[:type] return false if type_symbol == expected_type_symbol if type_registered?(type_symbol) type = type_for_declaration(type_symbol) type.extends?(BuiltinTypes[expected_type_symbol]) end end end def expected_type_symbol :model end def priority super - 1 end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems