Class: BaseTable
- Inherits:
-
Object
show all
- Defined in:
- lib/veye/views/base_table.rb
Direct Known Subclasses
Veye::Github::InfoTable, Veye::Github::ListTable, Veye::Github::SearchTable, Veye::Package::InfoTable, Veye::Package::ReferencesTable, Veye::Package::SearchTable, Veye::Package::VersionsTable, Veye::Project::DependencyTable, Veye::Project::InfoTable, Veye::Project::LicenceTable, Veye::User::FavoriteTable, Veye::User::ProfileTable
Instance Method Summary
collapse
Constructor Details
#initialize(title, headings) ⇒ BaseTable
Returns a new instance of BaseTable.
4
5
6
7
|
# File 'lib/veye/views/base_table.rb', line 4
def initialize(title, headings)
@title = title
@headings = headings
end
|
Instance Method Details
#after(paging = nil, allow_pagination = false) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/veye/views/base_table.rb', line 16
def after(paging = nil, = false)
if && !paging.nil?
= ['p', 'current_page', 'per_page', 'total_pages', 'total_entries']
paging_data = ["p"]
paging.each_pair do |key, val|
paging_data << val
end
@table.add_separator
@table <<
@table << paging_data
end
puts @table.to_s
end
|
#before ⇒ Object
9
10
11
12
13
14
|
# File 'lib/veye/views/base_table.rb', line 9
def before
@table = Terminal::Table.new :title => @title,
:headings => @headings
@table.align_column(0, :right)
end
|
31
32
33
|
# File 'lib/veye/views/base_table.rb', line 31
def format(result)
raise NotImplementedError
end
|