method

tokenize

v2_1_10 - Show latest stable - Class: Ripper
tokenize(src, filename = '-', lineno = 1)
public

Tokenizes the Ruby program and returns an array of strings.

p Ripper.tokenize("def m(a) nil end")
   # => ["def", " ", "m", "(", "a", ")", " ", "nil", " ", "end"]