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.38 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.37 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.36 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.35 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.34 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.33 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.32 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.31 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.30 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.29 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.28 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.27 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.26 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.25 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.24 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.23 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.22 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.21 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.20 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb
foobara-0.0.19 projects/type_declarations/src/handlers/extend_associative_array_type_declaration/to_type_transformer.rb