25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/steep/method_name.rb', line 25
def MethodName(string)
case string
when /#/
type_name, method_name = string.split(/#/, 2)
type_name or raise
method_name or raise
InstanceMethodName.new(type_name: RBS::TypeName.parse(type_name), method_name: method_name.to_sym)
when /\./
type_name, method_name = string.split(/\./, 2)
type_name or raise
method_name or raise
SingletonMethodName.new(type_name: RBS::TypeName.parse(type_name), method_name: method_name.to_sym)
else
raise "Unexpected method name: #{string}"
end
end
|