Sha256: ce42aa8b09bf81c9e8f63834b4d4a50ddf5d600fd01548f6d31db2df9cf7277c

Contents?: true

Size: 917 Bytes

Versions: 26

Compression:

Stored size: 917 Bytes

Contents

Foobara.require_project_file("type_declarations", "to_type_transformer")

module Foobara
  module TypeDeclarations
    module Handlers
      class RegisteredTypeDeclaration < TypeDeclarationHandler
        # TODO: seems like we have more base classes than we need
        class ToTypeTransformer < TypeDeclarations::ToTypeTransformer
          def transform(strict_type_declaration)
            registered_type(strict_type_declaration)
          end

          def type_symbol(strict_type_declaration)
            strict_type_declaration[:type]
          end

          def registered_type(strict_type_declaration)
            lookup_absolute_type!(type_symbol(strict_type_declaration), mode: Namespace::LookupMode::ABSOLUTE)
          end

          def target_classes(strict_type_declaration)
            registered_type(strict_type_declaration).target_classes
          end
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.25 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.24 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.23 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.22 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.21 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.20 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.19 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.18 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.17 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.16 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.15 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.14 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.13 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.12 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.11 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.10 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.9 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.8 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb
foobara-0.0.7 projects/type_declarations/src/handlers/registered_type_declaration/to_type_transformer.rb