Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/Inheritance-Single/Ruby/inheritance-single.rb
Normal file
22
Task/Inheritance-Single/Ruby/inheritance-single.rb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
class Animal
|
||||
#functions go here...
|
||||
def self.inherited(subclass)
|
||||
puts "new subclass of #{self}: #{subclass}"
|
||||
end
|
||||
end
|
||||
|
||||
class Dog < Animal
|
||||
#functions go here...
|
||||
end
|
||||
|
||||
class Cat < Animal
|
||||
#functions go here...
|
||||
end
|
||||
|
||||
class Lab < Dog
|
||||
#functions go here...
|
||||
end
|
||||
|
||||
class Collie < Dog
|
||||
#functions go here...
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue