SHARE
TWEET

Untitled

a guest Jul 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Vehicle  
  2.   @@registry = []
  3.   def self.register(vehicle)
  4.     @@registry << vehicle
  5.   end
  6. end
  7.  
  8. class Car < Vehicle  
  9.   def self.register(car)
  10.     # register car plate
  11.     super
  12.   end
  13. end
  14.  
  15. some_car = Car.new  
  16. Car.register(some_car)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top