require 'pagy/console'
include Pagy::Console
pagy_extras :array, :metadata, ...
pagy, items = pagy_array((1..1000).to_a, page: 3)
=> [
pagy_nav(pagy)
=> "<nav class=\"pagy nav\" aria-label=\"Pages\"><a href=\"http://www.example.com/subdir?page=2\" aria-label=\"Previous\"><</a><a href=\"http://www.example.com/subdir?page=1\">1</a><a href=\"http://www.example.com/subdir?page=2\">2</a><a role=\"link\" aria-disabled=\"true\" aria-current=\"page\" class=\"current\">3</a><a href=\"http://www.example.com/subdir?page=4\">4</a><a href=\"http://www.example.com/subdir?page=5\">5</a><a role=\"link\" aria-disabled=\"true\" class=\"gap\">…</a><a href=\"http://www.example.com/subdir?page=50\">50</a><a href=\"http://www.example.com/subdir?page=4\" aria-label=\"Next\">></a></nav>"
pagy_metadata(pagy)
=>
{ :scaffold_url => "http://www.example.com/subdir?page=__pagy_page__",
:first_url => "http://www.example.com/subdir?page=1",
:prev_url => "http://www.example.com/subdir?page=2",
:page_url => "http://www.example.com/subdir?page=3",
:next_url => "http://www.example.com/subdir?page=4",
:last_url => "http://www.example.com/subdir?page=50",
:count => 1000,
:page => 3,
:limit => 20,
:vars => { :page => 3,
:limit => 20,
:outset => 0,
:size => 7,
:cycle => false,
:count_args => [:all],
:page_param => :page,
:url => "http://www.example.com/subdir",
:metadata => [:scaffold_url,
:first_url,
:prev_url,
:page_url,
:next_url,
:last_url,
:count,
:page,
:limit,
:vars,
:pages,
:last,
:in,
:from,
:to,
:prev,
:next,
:series],
:count => 1000 },
:pages => 50,
:last => 50,
:in => 20,
:from => 41,
:to => 60,
:prev => 2,
:next => 4,
:series => [1, 2, "3", 4, 5, 6, 7] }