Skip to content

Instantly share code, notes, and snippets.

@raws
Created November 26, 2018 21:23
Show Gist options
  • Save raws/07002f33ff6cd2e0b6c638dc627ad3e5 to your computer and use it in GitHub Desktop.
Save raws/07002f33ff6cd2e0b6c638dc627ad3e5 to your computer and use it in GitHub Desktop.
Ruby array block argument splatting
[['foo', 'bar', 'baz']].each { |array| puts array.inspect }
#=> ["foo", "bar", "baz"]
[['foo', 'bar', 'baz']].each do |first, second, third|
puts first.inspect
puts second.inspect
puts third.inspect
end
#=> "foo"
#=> "bar"
#=> "baz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment