Class: TokyoMetro::App::Renderer::StationLinkList::MetaClass

Inherits:
Factory::Decorate::MetaClass show all
Defined in:
lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb

Direct Known Subclasses

English, Japanese

Instance Method Summary collapse

Constructor Details

#initialize(request, stations) ⇒ MetaClass

Returns a new instance of MetaClass.



3
4
5
6
# File 'lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb', line 3

def initialize( request , stations )
  super( request )
  @stations = stations
end

Instance Method Details

#renderObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb', line 8

def render
  h.render inline: <<-HAML , type: :haml , locals: h_locals
%ul{ id: domain_id }
- groups_of_letters.each do | group |
  %ul{ class: domain_class_name_of_column }
    - group.each do | letter |
      - name_list_in_a_letter = stations_grouped_by_first_letter[ letter ]
      - if name_list_in_a_letter.present?
        %li{ class: domain_class_name_of_each_letter }
          %h4{ class: :letter }<
            = letter
          %ul{ class: :stations }
            - name_list_in_a_letter.sort_by { | station | proc_for_sorting_name_list_in_a_letter_category.call( station ) }.each do | station |
              %li{ class: :station }<
                = proc_for_render_link.call( station )
  HAML
end