Advertisement
Guest User

Untitled

a guest
Feb 21st, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. module Battery
  2.  
  3. class Model1
  4.  
  5. def battery_type(x = "1h" )
  6. x
  7. end
  8.  
  9. def battery_hours
  10. @standard
  11. end
  12.  
  13. def battery
  14. y = 1
  15. y
  16. end
  17.  
  18. class Charger
  19. def initialize
  20. @charge = "500h"
  21. end
  22.  
  23. def lifetime
  24. @charge
  25. end
  26.  
  27. end
  28.  
  29. end
  30.  
  31. end
  32.  
  33. class Phone
  34. include Battery
  35.  
  36. def initialize
  37. @standard = '5 hours'
  38. end
  39.  
  40. #samsung = Phone.new
  41. #puts samsung.battery_type
  42. #puts samsung.battery_hours
  43. #puts Battery:Battery::Charger.new.lifetime
  44.  
  45. battery1 = Battery::Model1.new
  46. puts "aaaa",battery1.battery_hours
  47.  
  48. samsung = Phone.new
  49. puts "bbbb",samsung::Battery::Model1.battery_hours
  50.  
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement