Class: PostRunner::EventList

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

Overview

The EventList objects can generate a table that lists all the recorded FIT file events in chronological order.

Instance Method Summary collapse

Constructor Details

#initialize(activity, unit_system) ⇒ EventList

Create a DataSources object.

Parameters:

  • activity (Activity)

    The activity to analyze.

  • unit_system (Symbol)

    The unit system to use (:metric or :imperial )



31
32
33
34
35
# File 'lib/postrunner/EventList.rb', line 31

def initialize(activity, unit_system)
  @activity = activity
  @fit_activity = activity.fit_activity
  @unit_system = unit_system
end

Instance Method Details

#to_html(doc) ⇒ Object

Add the list as HTML table to the specified doc.

Parameters:



44
45
46
# File 'lib/postrunner/EventList.rb', line 44

def to_html(doc)
  ViewFrame.new('events', 'Events', 600, list, true).to_html(doc)
end

#to_sObject

Return the list as ASCII table



38
39
40
# File 'lib/postrunner/EventList.rb', line 38

def to_s
  list.to_s
end