Class: BaseCSV
- Inherits:
-
Object
- Object
- BaseCSV
- Defined in:
- lib/veye/views/base_csv.rb
Direct Known Subclasses
Veye::Github::InfoCSV, Veye::Github::ListCSV, Veye::Github::SearchCSV, Veye::Package::InfoCSV, Veye::Package::ReferencesCSV, Veye::Package::SearchCSV, Veye::Package::VersionsCSV, Veye::Project::DependencyCSV, Veye::Project::InfoCSV, Veye::Project::LicenceCSV, Veye::User::FavoriteCSV, Veye::User::ProfileCSV
Instance Method Summary collapse
- #after(paging = nil, allow_pagination = false) ⇒ Object
- #before ⇒ Object
- #format(results, n = 0, from = 0) ⇒ Object
-
#initialize(headers) ⇒ BaseCSV
constructor
A new instance of BaseCSV.
Constructor Details
#initialize(headers) ⇒ BaseCSV
Returns a new instance of BaseCSV.
3 4 5 |
# File 'lib/veye/views/base_csv.rb', line 3 def initialize(headers) @columns = headers end |
Instance Method Details
#after(paging = nil, allow_pagination = false) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/veye/views/base_csv.rb', line 10 def after(paging = nil, allow_pagination = false) if allow_pagination && !paging.nil? printf("# ------------------------------------------\n") printf("current_page,per_page,total_pages,total_entries\n") printf("%s,%s,%s,%s\n", paging['current_page'], paging['per_page'], paging['total_pages'], paging['total_entries']) end end |
#before ⇒ Object
7 8 9 |
# File 'lib/veye/views/base_csv.rb', line 7 def before puts @columns end |
#format(results, n = 0, from = 0) ⇒ Object
22 23 24 |
# File 'lib/veye/views/base_csv.rb', line 22 def format(results, n = 0, from = 0) raise NotImplementedError end |