Sha256: 7f38bbc7162df4845f530caf5660e9906ad9fd304fa1c096ec49738a7d72bbfd

Contents?: true

Size: 556 Bytes

Versions: 27

Compression:

Stored size: 556 Bytes

Contents

module Foobara
  module TypeDeclarations
    module Handlers
      class ExtendEntityTypeDeclaration < ExtendModelTypeDeclaration
        class PrimaryKeyDesugarizer < Desugarizer
          def applicable?(sugary_type_declaration)
            primary_key = sugary_type_declaration[:primary_key]

            primary_key.is_a?(::String)
          end

          def desugarize(sugary_type_declaration)
            sugary_type_declaration.merge(primary_key: sugary_type_declaration[:primary_key].to_sym)
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
foobara-0.0.7 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/primary_key_desugarizer.rb
foobara-0.0.6 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/primary_key_desugarizer.rb
foobara-0.0.5 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/primary_key_desugarizer.rb
foobara-0.0.4 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/primary_key_desugarizer.rb
foobara-0.0.3 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/primary_key_desugarizer.rb
foobara-0.0.2 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/primary_key_desugarizer.rb
foobara-0.0.1 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/primary_key_desugarizer.rb