Created
          January 27, 2012 05:48 
        
      - 
      
- 
        Save elijahmanor/1687251 to your computer and use it in GitHub Desktop. 
    Skype-enabled JavaScript Restaurant
  
        
  
    
      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
    
  
  
    
  | var restaurant = (function($) { | |
| var pub = {}, | |
| menu = [ "(pi)", "(^)" ], | |
| drinks = [ "(coffee)", "(beer)", "(d)" ]; | |
| pub.eat = function(call) { | |
| if ( call === "(pi)" ) { | |
| console.log( "(happy)" ); | |
| } else if ( call === "(^)" ) { | |
| console.log( "(party)" ); | |
| } else if ( call === "(bug)" ) { | |
| console.log( "(puke)" ); | |
| } | |
| }; | |
| pub.drink = function(call) { | |
| if ( call === "(beer)" || call === "(d)" ) { | |
| console.log( "(drunk)" ); | |
| } else if ( call === "(coffee)" ) { | |
| console.log( "(surprised)" ); | |
| } | |
| }; | |
| pub.listen = function(music) { | |
| console.log( "(dance)" ); | |
| }; | |
| return pub; | |
| }(jQuery)); | |
| restaurant.listen(); | |
| restaurant.eat( "(pi)" ); | |
| restaurant.drink( "(beer)" ); | |
| restaurant.eat( "(bug)" ); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment