123456789_123456789_123456789_123456789_123456789_

Class: RBS::Factory

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/factory.rb

Instance Method Summary

Instance Method Details

#type_name(string)

[ GitHub ]

  
# File 'lib/rbs/factory.rb', line 3

def type_name(string)
  absolute = string.start_with?("::")

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

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