Module: FoundationPagination::FoundationRenderer

Included in:
Rails, Sinatra
Defined in:
lib/foundation_pagination/foundation_renderer.rb

Overview

Contains functionality shared by all renderer classes.

Instance Method Summary collapse

Instance Method Details

#container_attributesObject



27
28
29
# File 'lib/foundation_pagination/foundation_renderer.rb', line 27

def container_attributes
  super.except(*[:link_options])
end

#html_container(html) ⇒ Object



23
24
25
# File 'lib/foundation_pagination/foundation_renderer.rb', line 23

def html_container(html)
  tag(:ul, html, container_attributes) 
end

#to_htmlObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/foundation_pagination/foundation_renderer.rb', line 7

def to_html
  list_items = pagination.map do |item|
    case item
      when Fixnum
        page_number(item)
      else
        send(item)
    end
  end.join(@options[:link_separator])

  if @options[:foundation].to_i >= 3
    tag("ul", list_items, :class => "pagination #{@options[:class]}")
  else
    html_container(tag("ul", list_items))
  end
end