Class: Ellington::LineInfo
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Ellington::LineInfo
- Defined in:
- lib/ellington/line_info.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#station_info ⇒ Object
readonly
Returns the value of attribute station_info.
Instance Method Summary collapse
-
#initialize(line, station_info) ⇒ LineInfo
constructor
A new instance of LineInfo.
- #log_message(options = {}) ⇒ Object
- #station_full_name ⇒ Object
Constructor Details
#initialize(line, station_info) ⇒ LineInfo
Returns a new instance of LineInfo.
7 8 9 10 11 |
# File 'lib/ellington/line_info.rb', line 7 def initialize(line, station_info) @line = line @station_info = station_info super station_info end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
5 6 7 |
# File 'lib/ellington/line_info.rb', line 5 def line @line end |
#station_info ⇒ Object (readonly)
Returns the value of attribute station_info.
5 6 7 |
# File 'lib/ellington/line_info.rb', line 5 def station_info @station_info end |
Instance Method Details
#log_message(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ellington/line_info.rb', line 17 def (={}) = [] if [:line_completed] << "[LINE COMPLETED]" << "[#{line.state(passenger)}]" << "[#{line.name}]" end if [:station_completed] << "[STATION COMPLETED]" << "[#{station.state(passenger)}]" << "[#{station_full_name}]" end line.route.[:passenger].each do |attr| << "[#{attr}:#{passenger.send(attr)}]" end line.route.[:options].each do |attr| << "[#{attr}:#{self.[attr]}]" end .join " " end |
#station_full_name ⇒ Object
13 14 15 |
# File 'lib/ellington/line_info.rb', line 13 def station_full_name @station_full_name ||= "#{station.class.name}::#{line.class.name}::#{line.route.name}" end |