Class: Ellington::Conductor
- Inherits:
-
Object
- Object
- Ellington::Conductor
- Defined in:
- lib/ellington/conductor.rb
Instance Attribute Summary collapse
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Instance Method Summary collapse
- #conduct(passenger) ⇒ Object
-
#initialize(route) ⇒ Conductor
constructor
A new instance of Conductor.
-
#verify(passenger) ⇒ Object
override this method in a subclass to perform actual passenger verification.
Constructor Details
#initialize(route) ⇒ Conductor
Returns a new instance of Conductor.
8 9 10 |
# File 'lib/ellington/conductor.rb', line 8 def initialize(route) @route = route end |
Instance Attribute Details
#route ⇒ Object (readonly)
Returns the value of attribute route.
6 7 8 |
# File 'lib/ellington/conductor.rb', line 6 def route @route end |
Instance Method Details
#conduct(passenger) ⇒ Object
18 19 20 21 22 |
# File 'lib/ellington/conductor.rb', line 18 def conduct(passenger) passenger = route.create_passenger(passenger) unless passenger.is_a?(Passenger) return unless verify(passenger) route.lines.first.board passenger end |
#verify(passenger) ⇒ Object
override this method in a subclass to perform actual passenger verification
14 15 16 |
# File 'lib/ellington/conductor.rb', line 14 def verify(passenger) true end |