Created
February 22, 2010 15:20
-
-
Save wookay/311151 to your computer and use it in GitHub Desktop.
Boogeyman
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
class Boogeyman | |
def self.latest | |
@@latest | |
end | |
# We'll redefine initialize | |
def initialize(name, location) | |
@name = name | |
@location = location | |
@@latest = @name | |
@@location = @location | |
puts "Yes, master?" | |
end | |
end | |
monster1 = Boogeyman.new("Macabre Mac", "Seattle, WA") | |
# → Yes, master? | |
monster2 = Boogeyman.new("Gory Gary", "Reston, WV") | |
# → Yes, master? | |
puts Boogeyman.latest | |
# → Gory Gary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment