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