Class: PostRunner::ActivityReport

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

Instance Method Summary collapse

Methods included from ViewWidgets

#frame, #view_widgets_style

Constructor Details

#initialize(activity) ⇒ ActivityReport

Returns a new instance of ActivityReport.



13
14
15
# File 'lib/postrunner/ActivityReport.rb', line 13

def initialize(activity)
  @activity = activity
end

Instance Method Details

#to_html(doc) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/postrunner/ActivityReport.rb', line 23

def to_html(doc)
  session = @activity.sessions[0]

  frame(doc, 'Summary') {
    summary(session).to_html(doc)
  }
  frame(doc, 'Laps') {
    laps.to_html(doc)
  }
end

#to_sObject



17
18
19
20
21
# File 'lib/postrunner/ActivityReport.rb', line 17

def to_s
  session = @activity.sessions[0]

  summary(session).to_s + "\n" + laps.to_s
end