Module: Pagy::UseOverflowExtra::Series

Defined in:
lib/pagy/extras/overflow.rb

Instance Method Summary collapse

Instance Method Details

#series(size = ) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/pagy/extras/overflow.rb', line 33

def series(size=@vars[:size])
  @page = @last                             # series for last page
  super(size).tap do |s|                    # call original series
    s[s.index(@page.to_s)] = @page          # string to integer (i.e. no current page)
    @page = @vars[:page]                    # restore the actual page
  end
end