Class: PostRunner::ActivityListView

Inherits:
Object
  • Object
show all
Includes:
Fit4Ruby::Converters, ViewWidgets
Defined in:
lib/postrunner/ActivityListView.rb

Defined Under Namespace

Classes: ActivityLink

Instance Method Summary collapse

Methods included from ViewWidgets

#button, #footer, #frame, #titlebar, #view_widgets_style

Constructor Details

#initialize(db) ⇒ ActivityListView

Returns a new instance of ActivityListView.



43
44
45
46
47
48
49
# File 'lib/postrunner/ActivityListView.rb', line 43

def initialize(db)
  @db = db
  @unit_system = @db.cfg[:unit_system]
  @page_size = 20
  @page_no = -1
  @last_page = (@db.activities.length - 1) / @page_size
end

Instance Method Details

#to_html(doc) ⇒ Object



58
59
60
# File 'lib/postrunner/ActivityListView.rb', line 58

def to_html(doc)
  generate_table.to_html(doc)
end

#to_sObject



62
63
64
# File 'lib/postrunner/ActivityListView.rb', line 62

def to_s
  generate_table.to_s
end

#update_html_indexObject



51
52
53
54
55
56
# File 'lib/postrunner/ActivityListView.rb', line 51

def update_html_index
  0.upto(@last_page) do |page_no|
    @page_no = page_no
    generate_html_index_page
  end
end