Sha256: 40f11e06f29818543d19b9418286f654c4e673ca88621e998c47d8e41a0e5c28

Contents?: true

Size: 956 Bytes

Versions: 38

Compression:

Stored size: 956 Bytes

Contents

Foobara.require_project_file(
  "type_declarations",
  "handlers/extend_registered_type_declaration/to_type_transformer"
)

module Foobara
  module TypeDeclarations
    module Handlers
      class ExtendAssociativeArrayTypeDeclaration < ExtendRegisteredTypeDeclaration
        class ToTypeTransformer < ExtendRegisteredTypeDeclaration::ToTypeTransformer
          def transform(strict_type_declaration)
            super.tap do |type|
              key_type_declaration = type.declaration_data[:key_type_declaration]
              value_type_declaration = type.declaration_data[:value_type_declaration]

              if key_type_declaration || value_type_declaration
                type.element_types = [
                  type_for_declaration(key_type_declaration || :duck),
                  type_for_declaration(value_type_declaration || :duck)
                ]
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
foobara-0.0.18 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.17 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.16 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.15 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.14 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.13 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.12 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.11 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.10 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.9 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.8 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.7 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.6 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.5 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.4 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.3 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.2 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.1 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb