Class: Gooby::History
- Inherits:
-
GoobyObject
- Object
- GoobyObject
- Gooby::History
- 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
-
#runs ⇒ Object
readonly
Returns the value of attribute runs.
Instance Method Summary collapse
-
#add_run(run) ⇒ Object
Adds a Run during XML parsing.
-
#initialize ⇒ History
constructor
A new instance of History.
- #print_string ⇒ Object
- #to_s ⇒ Object
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
#initialize ⇒ History
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
#runs ⇒ Object (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 |
#print_string ⇒ Object
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_s ⇒ Object
29 30 31 |
# File 'lib/gooby_history.rb', line 29 def to_s return "Hist: runs: #{@runs.size}" end |