Created
November 10, 2009 21:09
-
-
Save bolthar/231269 to your computer and use it in GitHub Desktop.
This file contains 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
# no OOP | |
value = "a" #somewhere else | |
if value == "a" | |
print "a!" | |
elsif value == "b" | |
print "b!" | |
elsif value == "c" | |
print "c!" | |
end | |
# OOP | |
class A | |
def dostuff | |
print "a!" | |
end | |
end | |
class B | |
def dostuff | |
print "b!" | |
end | |
end | |
class C | |
def dostuff | |
print "c!" | |
end | |
end | |
value = A.new # somewhere else | |
value.dostuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment