a
Ruby
code posted
created at 30 May 19:37
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
class Bicycle # This class is empty except for initialize. # Code has been moved to RoadBike. def initialize(**opts) end end class RoadBike < Bicycle # Now a subclass of Bicycle. # Contains all code from the old Bicycle class. end class MountainBike < Bicycle # Still a subclass of Bicycle. # Code has not changed. end |
351 Bytes in 2 ms with coderay