Class: TokyoMetro::App::Renderer::PassengerSurvey::SideMenu::MetaClass::EachYear
- Inherits:
-
Factory::Decorate::MetaClass
- Object
- RailsDecorateFactory
- Factory::Decorate::MetaClass
- TokyoMetro::App::Renderer::PassengerSurvey::SideMenu::MetaClass::EachYear
- Defined in:
- lib/tokyo_metro/app/renderer/passenger_survey/side_menu/meta_class/each_year.rb
Instance Method Summary collapse
-
#initialize(request, survey_year, survey_year_max, railway_line_page_name, only_year: true, with_operator_icon: false) ⇒ EachYear
constructor
A new instance of EachYear.
- #render ⇒ Object
Constructor Details
#initialize(request, survey_year, survey_year_max, railway_line_page_name, only_year: true, with_operator_icon: false) ⇒ EachYear
Returns a new instance of EachYear.
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/tokyo_metro/app/renderer/passenger_survey/side_menu/meta_class/each_year.rb', line 3 def initialize( request , survey_year , survey_year_max , railway_line_page_name , only_year: true , with_operator_icon: false ) super( request ) @survey_year = survey_year @survey_year_max = survey_year_max @railway_line_page_name = railway_line_page_name @only_year = only_year @with_operator_icon = with_operator_icon set_url end |
Instance Method Details
#render ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/tokyo_metro/app/renderer/passenger_survey/side_menu/meta_class/each_year.rb', line 14 def render h.render inline: <<-HAML , type: :haml , locals: h_locals %li{ class: li_classes } = link_to_unless( without_link , "" , url ) - if only_year %p{ class: :text_en }< = survey_year - else - if with_operator_icon %div{ class: :icon }< = ::TokyoMetro::App::Renderer::Icon.tokyo_metro( request , 1 ).render %div{ class: :text } %p{ class: :text_ja }< %span{ class: :text_en }< = survey_year != "年度" %p{ class: :text_en }< = "In " + survey_year.to_s HAML end |