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.
5 6 7 |
# File 'lib/ellington/conductor.rb', line 5 def initialize(route) @route = route end |
Instance Attribute Details
#route ⇒ Object (readonly)
Returns the value of attribute route.
3 4 5 |
# File 'lib/ellington/conductor.rb', line 3 def route @route end |
Instance Method Details
#conduct(passenger) ⇒ Object
15 16 17 18 |
# File 'lib/ellington/conductor.rb', line 15 def conduct(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
11 12 13 |
# File 'lib/ellington/conductor.rb', line 11 def verify(passenger) true end |