Class: TokyoMetro::App::Renderer::SideMenu

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

Defined Under Namespace

Modules: Link Classes: NowDeveloping, Problems

Class Method Summary collapse

Class Method Details

.all_list(request) ⇒ Object



23
24
25
# File 'lib/tokyo_metro/app/renderer/side_menu.rb', line 23

def all_list( request )
  list_names.map { | list_name | list_class_name.send( list_name , request ) }
end

.list_class_nameObject



15
16
17
# File 'lib/tokyo_metro/app/renderer/side_menu.rb', line 15

def list_class_name
  ::TokyoMetro::App::Renderer::SideMenu::Link::List
end

.list_namesObject



19
20
21
# File 'lib/tokyo_metro/app/renderer/side_menu.rb', line 19

def list_names
  [ :to_main_contents , :to_documents , :to_other_websites ]
end

.render_all(request) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/tokyo_metro/app/renderer/side_menu.rb', line 3

def self.render_all( request )
  h.render inline: <<-HAML , type: :haml , locals: { all_list: all_list( request ) }
%div{ id: :side_menu }
- all_list.each do | list |
  = list.render
  HAML
end