Created
          November 14, 2014 09:36 
        
      - 
      
 - 
        
Save pimeys/058f62de1b9cf94f121c to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def do_something | |
| puts "Starts" | |
| text = yield | |
| puts text | |
| end | |
| do_something do | |
| next "Now!" | |
| end | |
| do_something do | |
| return "Oh no!" | |
| end | |
| Starts | |
| Now! | |
| Starts | |
| foo.rb:12:in `block in <main>': unexpected return (LocalJumpError) | |
| from foo.rb:3:in `do_something' | |
| from foo.rb:11:in `<main>' | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment