Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Battery
- class Model1
- def battery_type(x = "1h" )
- x
- end
- def battery_hours
- @standard
- end
- def battery
- y = 1
- y
- end
- class Charger
- def initialize
- @charge = "500h"
- end
- def lifetime
- @charge
- end
- end
- end
- end
- class Phone
- include Battery
- def initialize
- @standard = '5 hours'
- end
- #samsung = Phone.new
- #puts samsung.battery_type
- #puts samsung.battery_hours
- #puts Battery:Battery::Charger.new.lifetime
- battery1 = Battery::Model1.new
- puts "aaaa",battery1.battery_hours
- samsung = Phone.new
- puts "bbbb",samsung::Battery::Model1.battery_hours
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement