Class: PostRunner::ActivityListView
- Inherits:
-
Object
- Object
- PostRunner::ActivityListView
- Includes:
- Fit4Ruby::Converters
- Defined in:
- lib/postrunner/ActivityListView.rb
Overview
Generates a paged list of all Activity objects in the database. HTML and plain text output are supported.
Instance Method Summary collapse
-
#initialize(ffs) ⇒ ActivityListView
constructor
A new instance of ActivityListView.
- #to_s ⇒ Object
- #update_index_pages ⇒ Object
Constructor Details
#initialize(ffs) ⇒ ActivityListView
Returns a new instance of ActivityListView.
27 28 29 30 31 32 33 |
# File 'lib/postrunner/ActivityListView.rb', line 27 def initialize(ffs) @ffs = ffs @unit_system = @ffs.store['config']['unit_system'].to_sym @page_size = 20 @page_no = -1 @last_page = (@ffs.activities.length - 1) / @page_size end |
Instance Method Details
#to_s ⇒ Object
42 43 44 |
# File 'lib/postrunner/ActivityListView.rb', line 42 def to_s generate_table.to_s end |
#update_index_pages ⇒ Object
35 36 37 38 39 40 |
# File 'lib/postrunner/ActivityListView.rb', line 35 def update_index_pages 0.upto(@last_page) do |page_no| @page_no = page_no generate_html_index_page(page_no) end end |