Skip to content

Instantly share code, notes, and snippets.

@JacobNinja
Created November 23, 2014 15:47
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 JacobNinja/f5fda976f38d23477547 to your computer and use it in GitHub Desktop.
Save JacobNinja/f5fda976f38d23477547 to your computer and use it in GitHub Desktop.
Destructuring with splat
class NilClass
def to_a
p 'calling to_a within NilClass'
[]
end
end
# irb(main):017:0> [*nil]
# "calling to_a within NilClass"
# => []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment