Skip to content

Instantly share code, notes, and snippets.

@dymk
Last active November 17, 2018 05:07
Show Gist options
  • Select an option

  • Save dymk/e198741cd875572af8e61d3138f0729e to your computer and use it in GitHub Desktop.

Select an option

Save dymk/e198741cd875572af8e61d3138f0729e to your computer and use it in GitHub Desktop.
def foo(args, &block)
bar(**args, &block) # I want to call bar with the block passed to foo
end
def bar(arg1:, &block)
block.call(arg1)
end
foo(arg1: "aaa!") do |param|
print param # aaa!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment