Sha256: 523f4db3a01595b3e20a2ae04d98b616fd876ff448503530d2df2c8d2a88a70a

Contents?: true

Size: 353 Bytes

Versions: 56

Compression:

Stored size: 353 Bytes

Contents

# frozen_string_literal: true

module RBS
  class Factory
    def type_name(string)
      absolute = string.start_with?("::")

      *path, name = string.delete_prefix("::").split("::").map(&:to_sym)

      name or raise

      TypeName.new(
        name: name,
        namespace: Namespace.new(path: path, absolute: absolute)
      )
    end
  end
end

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
rbs-3.8.1 lib/rbs/factory.rb
rbs-3.8.0 lib/rbs/factory.rb
rbs-3.8.0.pre.1 lib/rbs/factory.rb
rbs-3.7.0.pre.1 lib/rbs/factory.rb
rbs-3.7.0.dev.1 lib/rbs/factory.rb
rbs-3.6.1 lib/rbs/factory.rb
rbs-3.6.0 lib/rbs/factory.rb
rbs-3.6.0.pre.3 lib/rbs/factory.rb
rbs-3.6.0.pre.2 lib/rbs/factory.rb
rbs-3.6.0.pre.1 lib/rbs/factory.rb
rbs-3.6.0.dev.1 lib/rbs/factory.rb
rbs-3.5.3 lib/rbs/factory.rb
rbs-3.5.2 lib/rbs/factory.rb
rbs-3.5.1 lib/rbs/factory.rb
rbs-3.5.1.pre.1 lib/rbs/factory.rb
rbs-3.5.0 lib/rbs/factory.rb
rbs-3.5.0.pre.2 lib/rbs/factory.rb
rbs-3.5.0.pre.1 lib/rbs/factory.rb
rbs-3.4.4 lib/rbs/factory.rb
rbs-3.4.3 lib/rbs/factory.rb