Created
          November 10, 2012 20:48 
        
      - 
      
- 
        Save greggroth/4052437 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
    
  
  
    
  | pry(main)> edit dog.rb | |
| # opens up vim where I add: | |
| # | |
| # class Dog | |
| # def bark | |
| # puts "Woof!" | |
| # end | |
| # end | |
| pry(main)> my_dog = Dog.new | |
| => #<Dog:0x007feb4b821f20> | |
| pry(main)> my_dog.bark | |
| Woof! | |
| => nil | |
| pry(main)> edit dog.rb | |
| # opens up vim and I change it to: | |
| # | |
| # class Dog | |
| # def initialize(bark) | |
| # @bark = bark | |
| # end | |
| # | |
| # def bark | |
| # puts @bark | |
| # end | |
| # end | |
| [8] pry(main)> his_dog = Dog.new("Rufff!") | |
| => #<Dog:0x007feb4b21a8c0 @bark="Rufff!"> | |
| [9] pry(main)> his_dog.bark | |
| Rufff! | |
| => nil | |
| pry(main)> .ls | ack dog | |
| dog.rb | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment