Skip to content

Instantly share code, notes, and snippets.

@mehdi-farsi
Created August 24, 2018 13:59
Show Gist options
  • Save mehdi-farsi/f5c0d9fd957997ee1e1046a1520526c9 to your computer and use it in GitHub Desktop.
Save mehdi-farsi/f5c0d9fd957997ee1e1046a1520526c9 to your computer and use it in GitHub Desktop.
def yield_with_arguments
hello = 'Hello'
world = 'World!'
yield(hello, world)
end
yield_with_arguments { |hello, world| puts "#{hello} #{world}" } # => Hello World!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment