Class: TokyoMetro::App::Renderer::RealTimeInfos::EachRailwayLine
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::RealTimeInfos::EachRailwayLine
- Defined in:
- lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb
Constant Summary collapse
- TRAIN_OPERATION_STATUS_FOR_TEST =
::YAML.load_file( "#{ ::TokyoMetro::DICTIONARY_DIR }/view/train_operation_status_for_test.yaml" )
Instance Attribute Summary collapse
-
#railway_line ⇒ Object
readonly
Returns the value of attribute railway_line.
-
#train_location_infos ⇒ Object
readonly
Returns the value of attribute train_location_infos.
-
#train_operation_info ⇒ Object
readonly
Returns the value of attribute train_operation_info.
Instance Method Summary collapse
-
#initialize(request, railway_line, http_client, test_mode) ⇒ EachRailwayLine
constructor
A new instance of EachRailwayLine.
- #render_train_location_infos ⇒ Object
- #render_train_operation_info(controller) ⇒ Object
- #update_train_operation_text_in_db ⇒ Object
Constructor Details
#initialize(request, railway_line, http_client, test_mode) ⇒ EachRailwayLine
Returns a new instance of EachRailwayLine.
5 6 7 8 9 10 11 |
# File 'lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb', line 5 def initialize( request , railway_line , http_client , test_mode ) super( request ) @railway_line = railway_line get_train_operation_info( http_client , test_mode ) get_train_location_infos( http_client , test_mode ) set_max_delay end |
Instance Attribute Details
#railway_line ⇒ Object (readonly)
Returns the value of attribute railway_line.
13 14 15 |
# File 'lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb', line 13 def railway_line @railway_line end |
#train_location_infos ⇒ Object (readonly)
Returns the value of attribute train_location_infos.
15 16 17 |
# File 'lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb', line 15 def train_location_infos @train_location_infos end |
#train_operation_info ⇒ Object (readonly)
Returns the value of attribute train_operation_info.
14 15 16 |
# File 'lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb', line 14 def train_operation_info @train_operation_info end |
Instance Method Details
#render_train_location_infos ⇒ Object
21 22 23 24 25 |
# File 'lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb', line 21 def render_train_location_infos if @train_location_infos.present? @train_location_infos.decorate( request , @railway_line ).render end end |
#render_train_operation_info(controller) ⇒ Object
17 18 19 |
# File 'lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb', line 17 def render_train_operation_info( controller ) @train_operation_info.decorate( request , @railway_line , @max_delay , controller , no_train? ).render end |
#update_train_operation_text_in_db ⇒ Object
27 28 29 30 31 |
# File 'lib/tokyo_metro/app/renderer/real_time_infos/each_railway_line.rb', line 27 def update_train_operation_text_in_db if @train_operation_info.instance_of?( ::TokyoMetro::Api::TrainOperation::Info ) @train_operation_info.update_train_operation_text_in_db end end |