Skip to content

Instantly share code, notes, and snippets.

@makimoto
Created November 2, 2013 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makimoto/7275810 to your computer and use it in GitHub Desktop.
Save makimoto/7275810 to your computer and use it in GitHub Desktop.
➜ ~ pry -rripper
[1] pry(main)> Ripper.sexp("a")
=> [:program, [[:vcall, [:@ident, "a", [1, 0]]]]]
[2] pry(main)> Ripper.sexp("b = 1")
=> [:program,
[[:assign, [:var_field, [:@ident, "b", [1, 0]]], [:@int, "1", [1, 4]]]]]
[3] pry(main)> Ripper.sexp("c ||= 1")
=> [:program,
[[:opassign,
[:var_field, [:@ident, "c", [1, 0]]],
[:@op, "||=", [1, 2]],
[:@int, "1", [1, 6]]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment