Skip to content

Instantly share code, notes, and snippets.

@Arakaki
Created September 9, 2013 09:33
Show Gist options
  • Save Arakaki/6493469 to your computer and use it in GitHub Desktop.
Save Arakaki/6493469 to your computer and use it in GitHub Desktop.
def default_argument_for_block
yield
end
default_argument_for_block do |val = 'Hi'|
puts val
end
def flexible_arguments_for_block
yield 1,2,3
end
flexible_arguments_for_block do |*params|
puts params.inspect
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment