Advertisement
Guest User

Untitled

a guest
Sep 21st, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.50 KB | None | 0 0
  1. class Song
  2.  
  3.     def initialize(lyrics)
  4.         @lyrics = lyrics
  5.     end
  6.  
  7.     def sing_me_a_song()
  8.         for line in @lyrics
  9.             puts line
  10.         end
  11.     end
  12. end
  13.  
  14. happy_bday = Song.new(["Happy birthday to you",
  15.                    "I don't want to get sued",
  16.                    "So I'll stop right there"])
  17.  
  18. bulls_on_parade = Song.new(["They rally around the family",
  19.                         "With pockets full of shells"])
  20.  
  21. happy_bday.sing_me_a_song()
  22.  
  23. bulls_on_parade.sing_me_a_song()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement