class RBS::Annotate::Annotations::Copy

def partition

def partition
  case
  when match = source.match(/(?<constant_name>[^#]+)#(?<method_name>.+)/)
    [
      TypeName.parse(match[:constant_name] || raise),
      [
        false,
        (match[:method_name] or raise).to_sym
      ]
    ]
  when match = source.match(/(?<constant_name>[^#]+)\.(?<method_name>.+)/)
    [
      TypeName.parse(match[:constant_name] || raise),
      [
        true,
        (match[:method_name] or raise).to_sym
      ]
    ]
  else
    [
      TypeName.parse(source),
      nil
    ]
  end
end