Skip to content

Instantly share code, notes, and snippets.

@shunwen
Created July 31, 2013 08:37
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 shunwen/6120379 to your computer and use it in GitHub Desktop.
Save shunwen/6120379 to your computer and use it in GitHub Desktop.
Use #is_a? instead of #===
omg = [1,2,3]
omg ===Array # => false
Array === omg # => true
omg.is_a? Array # => true
tmp = 1
tmp.is_a? Array #=> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment