Class: PostRunner::ActivitySummary

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

Instance Method Summary collapse

Constructor Details

#initialize(fit_activity, unit_system, custom_fields) ⇒ ActivitySummary

Returns a new instance of ActivitySummary.



24
25
26
27
28
29
30
# File 'lib/postrunner/ActivitySummary.rb', line 24

def initialize(fit_activity, unit_system, custom_fields)
  @fit_activity = fit_activity
  @name = custom_fields[:name]
  @type = custom_fields[:type]
  @sub_type = custom_fields[:sub_type]
  @unit_system = unit_system
end

Instance Method Details

#to_html(doc) ⇒ Object



36
37
38
39
40
# File 'lib/postrunner/ActivitySummary.rb', line 36

def to_html(doc)
  width = 600
  ViewFrame.new("Activity: #{@name}", width, summary).to_html(doc)
  ViewFrame.new('Laps', width, laps).to_html(doc)
end

#to_sObject



32
33
34
# File 'lib/postrunner/ActivitySummary.rb', line 32

def to_s
  summary.to_s + "\n" + laps.to_s
end