class TokyoMetro::App::Renderer::StationLinkList::MetaClass

Public Class Methods

new( request , stations ) click to toggle source
Calls superclass method
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 3
def initialize( request , stations )
  super( request )
  @stations = stations
end

Public Instance Methods

render() click to toggle source
# 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

Private Instance Methods

domain_class_name_of_column() click to toggle source
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 56
def domain_class_name_of_column
  raise "Error: This method \'#{ __method__ }\' is not defined yet."
end
domain_class_name_of_each_letter() click to toggle source
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 60
def domain_class_name_of_each_letter
  raise "Error: This method \'#{ __method__ }\' is not defined yet."
end
domain_id() click to toggle source
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 52
def domain_id
  raise "Error: This method \'#{ __method__ }\' is not defined yet."
end
groups_of_letters() click to toggle source
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 64
def groups_of_letters
  raise "Error: This method \'#{ __method__ }\' is not defined yet."
end
h_locals() click to toggle source
Calls superclass method
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 28
def h_locals
  super.merge({
    stations_grouped_by_first_letter: stations_grouped_by_first_letter ,
    proc_for_sorting_name_list_in_a_letter_category: proc_for_sorting_name_list_in_a_letter_category ,
    proc_for_render_link: proc_for_render_link ,
    domain_id: domain_id ,
    domain_class_name_of_column: domain_class_name_of_column ,
    domain_class_name_of_each_letter: domain_class_name_of_each_letter ,
    groups_of_letters: groups_of_letters
  })
end
proc_for_sorting_name_list_in_a_letter_category() click to toggle source
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 44
def proc_for_sorting_name_list_in_a_letter_category
  raise "Error: This method \'#{ __method__ }\' is not defined yet."
end
stations_grouped_by_first_letter() click to toggle source
# File lib/tokyo_metro/app/renderer/station_link_list/meta_class.rb, line 40
def stations_grouped_by_first_letter
  raise "Error: This method \'#{ __method__ }\' is not defined yet."
end