Class: Gooby::History

Inherits:
GoobyObject show all
Defined in:
lib/gooby_history.rb

Overview

Instances of this class represent a <History> aggregate object from a

Forerunner XML file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GoobyKernel

#character_align, #default_delimiter, #invalid_altitude, #invalid_heartbeat, #invalid_latitude, #invalid_longitude, #invalid_time, #project_author, #project_copyright, #project_date, #project_embedded_comment, #project_license, #project_name, #project_version_number, #project_year, #read_as_ascii_lines, #read_lines, #strip_lines, #tokenize

Constructor Details

#initializeHistory

Returns a new instance of History.



20
21
22
# File 'lib/gooby_history.rb', line 20

def initialize
  @runs = Array.new
end

Instance Attribute Details

#runsObject (readonly)

Returns the value of attribute runs.



18
19
20
# File 'lib/gooby_history.rb', line 18

def runs
  @runs
end

Instance Method Details

#add_run(run) ⇒ Object

Adds a Run during XML parsing.



25
26
27
# File 'lib/gooby_history.rb', line 25

def add_run(run)  
  @runs.push(run)    
end


33
34
35
36
37
# File 'lib/gooby_history.rb', line 33

def print_string
  s = "History: run count=#{@runs.size} \n"
  runs.each { | run | s << run.print_string }
  s
end

#to_sObject



29
30
31
# File 'lib/gooby_history.rb', line 29

def to_s
  return "Hist: runs: #{@runs.size}"
end