Created
March 25, 2019 12:41
-
-
Save jyothu/bf072698c704fc54ccccd397773ee63f to your computer and use it in GitHub Desktop.
Implement count method - Usage of class variable & instance variable
This file contains hidden or 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 Vehicle | |
end | |
class Car < Vehicle | |
end | |
class Bus < Vehicle | |
end | |
class Jeep < Vehicle | |
end | |
Jeep.new(name: 'Compass') | |
Bus.new(name: 'Airavat') | |
Car.new(name: 'Wagon R') | |
# implement Vehicle.count and it should return 3 in the above case. | |
Vehicle.count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment