Skip to content

Instantly share code, notes, and snippets.

@julioterra
Created October 3, 2011 05:44
Show Gist options
  • Select an option

  • Save julioterra/1258508 to your computer and use it in GitHub Desktop.

Select an option

Save julioterra/1258508 to your computer and use it in GitHub Desktop.
yield method basics
def yielding_method
puts “pre-yield”
yield(“message from yielding method”)
puts “post-yield”
end
yielding_method {|i| puts “yield code block #{i}” }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment