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.4.2 lib/rbs/factory.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/lib/rbs/factory.rb
rbs-3.4.1 lib/rbs/factory.rb
rbs-3.4.0 lib/rbs/factory.rb
rbs-3.4.0.pre.1 lib/rbs/factory.rb
rbs-3.3.2 lib/rbs/factory.rb
rbs-3.3.1 lib/rbs/factory.rb
rbs-3.3.0 lib/rbs/factory.rb
rbs-3.3.0.pre.2 lib/rbs/factory.rb
rbs-3.3.0.pre.1 lib/rbs/factory.rb
rbs-3.2.2 lib/rbs/factory.rb
rbs-3.2.1 lib/rbs/factory.rb
rbs-3.2.0 lib/rbs/factory.rb
rbs-3.2.0.pre.1 lib/rbs/factory.rb
rbs-3.1.3 lib/rbs/factory.rb
rbs-3.1.2 lib/rbs/factory.rb
rbs-3.1.1 lib/rbs/factory.rb
rbs-3.1.0 lib/rbs/factory.rb
rbs-3.0.4 lib/rbs/factory.rb
rbs-3.0.3 lib/rbs/factory.rb