Skip to content

Instantly share code, notes, and snippets.

@bolthar
Created November 10, 2009 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bolthar/231269 to your computer and use it in GitHub Desktop.
Save bolthar/231269 to your computer and use it in GitHub Desktop.
# 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