Sha256: 5cc9a9f7002a445fa15068ce8d66d9f21b1f06a0e55aff7332697109dae089e6

Contents?: true

Size: 780 Bytes

Versions: 9

Compression:

Stored size: 780 Bytes

Contents

module Foobara
  module TypeDeclarations
    module Handlers
      class ExtendEntityTypeDeclaration < ExtendDetachedEntityTypeDeclaration
        class ToTypeTransformer < ExtendDetachedEntityTypeDeclaration::ToTypeTransformer
          def process_value(strict_declaration_type)
            super.tap do |outcome|
              if outcome.success?
                type = outcome.result
                entity_class = type.target_class

                unless entity_class.can_be_created_through_casting?
                  type.casters = type.casters.reject do |caster|
                    caster.is_a?(Foobara::BuiltinTypes::Entity::Casters::Hash)
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foobara-0.0.47 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.46 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.45 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.44 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.43 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.42 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.41 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.40 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb
foobara-0.0.39 projects/entity/src/extensions/type_declarations/handlers/extend_entity_type_declaration/to_type_transformer.rb