class TokyoMetro::Factory::Decorate::Api::TrainOperation::Common
Attributes
controller[R]
railway_line[R]
status_type[R]
Public Class Methods
new( request , obj , railway_line , controller )
click to toggle source
Calls superclass method
TokyoMetro::Factory::Decorate::Api::MetaClass::RealTime::Info::new
# File lib/tokyo_metro/factory/decorate/api/train_operation/common.rb, line 3 def initialize( request , obj , railway_line , controller ) super( request , obj ) @railway_line = railway_line @controller = controller end
Public Instance Methods
render()
click to toggle source
# File lib/tokyo_metro/factory/decorate/api/train_operation/common.rb, line 13 def render h.render inline: <<-HAML , type: :haml , locals: { this: self } %li{ class: [ :train_operation_info , :railway_line , :clearfix ] } = this.railway_line.decorate.render_matrix( make_link_to_railway_line: true , size: :small , link_controller_name: this.controller ) %div{ class: [ :status , this.status_type ] } %div{ class: :infos } = this.render_status_icon_and_text = this.render_status_additional_infos HAML end
render_status_icon_and_text()
click to toggle source
# File lib/tokyo_metro/factory/decorate/api/train_operation/common.rb, line 24 def render_status_icon_and_text h.render inline: <<-HAML , type: :haml , locals: { this: self } %div{ class: :icon }< = ::TokyoMetro::App::Renderer::Icon.send( this.status_type , request , 3 ).render %div{ class: :text } %p{ class: :text_ja }< = this.status_text_ja %p{ class: :text_en }< = this.status_text_en HAML end