Class: TokyoMetro::App::Renderer::SideMenu::Link::List

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

Instance Method Summary collapse

Constructor Details

#initialize(request, class_name, ul_id, link_instance_names, *options, additional_proc: nil) ⇒ List

Returns a new instance of List.



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

def initialize( request , class_name , ul_id , link_instance_names , *options , additional_proc: nil )
  @request = request
  @ul_id = ul_id
  @link_instances = set_link_instances( class_name , link_instance_names.flatten , options )
  @additional_proc = additional_proc
end

Instance Method Details

#renderObject



10
11
12
13
14
15
16
17
18
# File 'lib/tokyo_metro/app/renderer/side_menu/link/list.rb', line 10

def render
  h.render inline: <<-HAML , type: :haml , locals: h_locals
%ul{ id: ul_id , class: [ :links , :clearfix ] }
- link_instances.each do | link_instance |
  = link_instance.render
- if additional_proc.present?
= additional_proc.call( this )
  HAML
end