Class: Ellington::Conductor

Inherits:
Object
  • Object
show all
Defined in:
lib/ellington/conductor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#routeObject (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