Class: Veye::Pagination::PaginationTable

Inherits:
Object
  • Object
show all
Defined in:
lib/veye/pagination/pagination_table.rb

Instance Method Summary collapse

Instance Method Details

#afterObject



12
13
14
# File 'lib/veye/pagination/pagination_table.rb', line 12

def after
  puts @@table.to_s
end

#beforeObject



6
7
8
9
10
# File 'lib/veye/pagination/pagination_table.rb', line 6

def before
  @@table = Terminal::Table.new :title => "Pagination",
                                :headings => %w(current_page per_page total_pages total_entries)
  @@table.align_column(0, :right)
end

#format(paging) ⇒ Object



16
17
18
19
# File 'lib/veye/pagination/pagination_table.rb', line 16

def format(paging)
  row = [paging['current_page'], paging['per_page'], paging['total_pages'], paging['total_entries']]
  @@table << row
end