Class: Gooby::TrainingCenterXmlSplitter
- Inherits:
-
GoobyObject
- Object
- GoobyObject
- Gooby::TrainingCenterXmlSplitter
- Defined in:
- lib/gooby_training_center_xml_splitter.rb
Overview
Instances of this class are used to split a large Garmin TrainingCenter
*.tcx file into individual 'activity_' files.
Instance Attribute Summary collapse
-
#out_dir ⇒ Object
readonly
Returns the value of attribute out_dir.
-
#out_files_hash ⇒ Object
readonly
Returns the value of attribute out_files_hash.
-
#training_center_files ⇒ Object
readonly
Returns the value of attribute training_center_files.
Instance Method Summary collapse
-
#initialize(tcx_file, out_dir) ⇒ TrainingCenterXmlSplitter
constructor
A new instance of TrainingCenterXmlSplitter.
- #split ⇒ 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(tcx_file, out_dir) ⇒ TrainingCenterXmlSplitter
Returns a new instance of TrainingCenterXmlSplitter.
20 21 22 23 24 25 |
# File 'lib/gooby_training_center_xml_splitter.rb', line 20 def initialize(tcx_file, out_dir) @out_dir = out_dir @training_center_files = Array.new @training_center_files << tcx_file @out_files_hash = Hash.new end |
Instance Attribute Details
#out_dir ⇒ Object (readonly)
Returns the value of attribute out_dir.
18 19 20 |
# File 'lib/gooby_training_center_xml_splitter.rb', line 18 def out_dir @out_dir end |
#out_files_hash ⇒ Object (readonly)
Returns the value of attribute out_files_hash.
18 19 20 |
# File 'lib/gooby_training_center_xml_splitter.rb', line 18 def out_files_hash @out_files_hash end |
#training_center_files ⇒ Object (readonly)
Returns the value of attribute training_center_files.
18 19 20 |
# File 'lib/gooby_training_center_xml_splitter.rb', line 18 def training_center_files @training_center_files end |
Instance Method Details
#split ⇒ Object
27 28 29 30 |
# File 'lib/gooby_training_center_xml_splitter.rb', line 27 def split @training_center_files.each { |f| process_file(f) } write_files end |