SHARE
TWEET

Untitled

a guest Sep 18th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
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
 
Top