Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class TollGate
  2. def initialize(card)
  3. @status = 0
  4. end
  5.  
  6. def open_gate
  7. @status = 1
  8. end
  9.  
  10. def close_gate
  11. @status = 0
  12. end
  13. end
  14.  
  15. class Sensor
  16. def initialize(card)
  17. @card = card
  18. end
  19.  
  20. def is_right_card?
  21. true if @card == 'toll-card'
  22. false
  23. end
  24. end
  25.  
  26. class Checker
  27. def initialize(balance)
  28. @balance = balance
  29. end
  30.  
  31. def is_balance_enough?
  32. true if @balance >= 3000
  33. false
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement