Sha256: f8e3f1beb43ac4382dbf7302f950898338bb879bc0e6cf6c1ae50b57e8af0ed0
Contents?: true
Size: 768 Bytes
Versions: 38
Compression:
Stored size: 768 Bytes
Contents
module Foobara module TypeDeclarations module Handlers class ExtendRegisteredModelTypeDeclaration < ExtendRegisteredTypeDeclaration class ModelClassTypeDesugarizer < TypeDeclarations::Desugarizer def applicable?(sugary_type_declaration) if sugary_type_declaration.is_a?(::Hash) && sugary_type_declaration.key?(:type) type = sugary_type_declaration[:type] type.is_a?(::Class) && type < Model end end def desugarize(hash) model_class = hash[:type] hash.merge(type: model_class.model_type.foobara_manifest_reference.to_sym) end def priority Priority::FIRST end end end end end end
Version data entries
38 entries across 38 versions & 1 rubygems