Class: Ellington::RouteInfo
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Ellington::RouteInfo
- Defined in:
- lib/ellington/route_info.rb
Instance Attribute Summary collapse
-
#line_info ⇒ Object
readonly
Returns the value of attribute line_info.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Instance Method Summary collapse
-
#initialize(route, line_info) ⇒ RouteInfo
constructor
A new instance of RouteInfo.
- #passenger_message ⇒ Object
- #route_completed_message ⇒ Object
Constructor Details
#initialize(route, line_info) ⇒ RouteInfo
Returns a new instance of RouteInfo.
7 8 9 10 11 |
# File 'lib/ellington/route_info.rb', line 7 def initialize(route, line_info) @route = route @line_info = line_info super line_info end |
Instance Attribute Details
#line_info ⇒ Object (readonly)
Returns the value of attribute line_info.
5 6 7 |
# File 'lib/ellington/route_info.rb', line 5 def line_info @line_info end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
5 6 7 |
# File 'lib/ellington/route_info.rb', line 5 def route @route end |
Instance Method Details
#passenger_message ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/ellington/route_info.rb', line 22 def route.passenger_attrs_to_log.reduce([]) do |memo, attr| value = passenger.send(attr) rescue nil memo << "[#{attr}:#{value}]" unless value.nil? memo end end |
#route_completed_message ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/ellington/route_info.rb', line 13 def = [] << "[ROUTE COMPLETED]" << "[#{route.state(passenger)}]" << "[#{route.name}]" .concat .join " " end |