Object
# File rbs-2.1.0/lib/rbs/annotate/annotations.rb, line 82
def ==(other)
other.is_a?(Copy) &&
other.annotation == annotation &&
other.source == source
end
# File rbs-2.1.0/lib/rbs/annotate/annotations.rb, line 78
def hash
self.class.hash ^ annotation.hash ^ source.hash
end
# File rbs-2.1.0/lib/rbs/annotate/annotations.rb, line 62
def method_name
_, m = partition
if m
m[1]
end
end
# File rbs-2.1.0/lib/rbs/annotate/annotations.rb, line 90
def partition
case
when match = source.match(/(?<constant_name>[^#]+)#(?<method_name>.+)/)
[
TypeName(match[:constant_name] || raise),
[
false,
(match[:method_name] or raise).to_sym
]
]
when match = source.match(/(?<constant_name>[^#]+)\.(?<method_name>.+)/)
[
TypeName(match[:constant_name] || raise),
[
true,
(match[:method_name] or raise).to_sym
]
]
else
[
TypeName(source),
nil
]
end
end