Skip to content

Instantly share code, notes, and snippets.

@teenst
Created January 20, 2015 15:32
Show Gist options
  • Save teenst/c202aeaf0e16d0cad500 to your computer and use it in GitHub Desktop.
Save teenst/c202aeaf0e16d0cad500 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def block_sample
puts 'stand up'
yield if block_given?
puts 'sit down'
end
block_sample do
puts 'walk'
end
block_sample()
#!/usr/bin/env ruby
catch :triple_loop do
loop do
puts 'one'
loop do
puts 'two'
loop do
puts 'three'
throw :triple_loop
end
end
end
end
#!/usr/bin/env ruby
catch :entire do
catch :process do
throw :entire
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment