Permalink
Browse files

Somewhat cleaner #to_html

  • Loading branch information...
1 parent 29c77a9 commit a273a6814ed794a8fbd0534cde903a1cb736a792 @tj committed Oct 8, 2009
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/dm-pagination/pager.rb
View
12 lib/dm-pagination/pager.rb
@@ -63,9 +63,15 @@ def to_html uri, options = {}
@size = options.fetch :size, Pagination.defaults[:size]
raise ArgumentError, 'invalid :size; must be an odd number' if @size % 2 == 0
@size /= 2
- %(<ul class="#{Pagination.defaults[:pager_class]}">) + first_link + previous_link +
- more(:before) + intermediate_links.join("\n") + more(:after) +
- next_link + last_link + '</ul>'
+ [%(<ul class="#{Pagination.defaults[:pager_class]}">),
+ first_link,
+ previous_link,
+ more(:before),
+ intermediate_links.join("\n"),
+ more(:after),
+ next_link,
+ last_link,
+ '</ul>'].join
end
private

0 comments on commit a273a68

Please sign in to comment.