Skip to content

Instantly share code, notes, and snippets.

@fidalgo
Created September 10, 2015 16:10
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 fidalgo/ef8ad2d31ad57787d588 to your computer and use it in GitHub Desktop.
Save fidalgo/ef8ad2d31ad57787d588 to your computer and use it in GitHub Desktop.
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