-
-
Save fidalgo/ef8ad2d31ad57787d588 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
class Shape | |
def initialize(name) | |
@name = name | |
puts "New shape #{name} has #{SIDES} sides" | |
end | |
end | |
class Triangle < Shape | |
SIDES = 3 | |
end | |
class Square < Shape | |
SIDES = 4 | |
end | |
tg = Triangle.new('isometric') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment