?
is not a method in this case but rather a parsable syntax. ?
is a character literal in this context
Docs Excerpt:
There is also a character literal notation to represent single character strings, which syntax is a question mark (?) followed by a single character or escape sequence that corresponds to a single codepoint in the script encoding:
?a #=> "a"
?abc #=> SyntaxError
?\n #=> "\n"
?\s #=> " "
?\\ #=> "\\"
?\u{41} #=> "A"
?\C-a #=> "\x01"
?\M-a #=> "\xE1"
?\M-\C-a #=> "\x81"
?\C-\M-a #=> "\x81", same as above
?あ #=> "あ"
You have also found another fun little mechanism of the parser which is 2 Strings can be concatenated together by simply placing them side by side (with or without white space). e.g.
"1" "234"
#=> "1234"
"1""234"
#=> "1234"