Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Somewhat cleaner #to_html

  • Loading branch information...
commit a273a6814ed794a8fbd0534cde903a1cb736a792 1 parent 29c77a9
TJ Holowaychuk authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/dm-pagination/pager.rb
12 lib/dm-pagination/pager.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.