class RBS::Factory - rbs: Ruby Standard Library Documentation

# class RBS::Factory

### Public Instance Methods

type_name(string) click to toggle source

    # File rbs-3.8.0/lib/rbs/factory.rb, line 5
    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