Skip to content

Instantly share code, notes, and snippets.

@sam
Created November 28, 2012 15:37
Show Gist options
  • Save sam/4162035 to your computer and use it in GitHub Desktop.
Save sam/4162035 to your computer and use it in GitHub Desktop.
Symbol.all_symbols behavior
irb(main):010:0> Symbol.all_symbols.map(&:to_s).grep /all_symbols/
=> []
irb(main):011:0> Symbol.all_symbols.map(&:to_s).grep /foocowbar/
=> []
irb(main):012:0> def foocowbar; nil; end
=> nil
irb(main):013:0> Symbol.all_symbols.map(&:to_s).grep /foocowbar/
=> ["foocowbar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment