Class: ValuesReaderV2
- Inherits:
-
Object
- Object
- ValuesReaderV2
- Includes:
- LogUtils::Logging
- Defined in:
- lib/textutils/reader/values_reader.rb
Overview
todo/fix: find a better name than HashReaderV2 (HashReaderPlus?) ??
Instance Attribute Summary collapse
-
#include_path ⇒ Object
readonly
Returns the value of attribute include_path.
-
#more_attribs ⇒ Object
readonly
Returns the value of attribute more_attribs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #each_line ⇒ Object
-
#initialize(name, include_path, more_attribs = {}) ⇒ ValuesReaderV2
constructor
A new instance of ValuesReaderV2.
Constructor Details
#initialize(name, include_path, more_attribs = {}) ⇒ ValuesReaderV2
Returns a new instance of ValuesReaderV2.
10 11 12 13 14 |
# File 'lib/textutils/reader/values_reader.rb', line 10 def initialize( name, include_path, more_attribs={} ) @name = name @include_path = include_path @more_attribs = more_attribs end |
Instance Attribute Details
#include_path ⇒ Object (readonly)
Returns the value of attribute include_path.
17 18 19 |
# File 'lib/textutils/reader/values_reader.rb', line 17 def include_path @include_path end |
#more_attribs ⇒ Object (readonly)
Returns the value of attribute more_attribs.
18 19 20 |
# File 'lib/textutils/reader/values_reader.rb', line 18 def more_attribs @more_attribs end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/textutils/reader/values_reader.rb', line 16 def name @name end |
Instance Method Details
#each_line ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/textutils/reader/values_reader.rb', line 20 def each_line path = "#{include_path}/#{name}.txt" reader = ValuesReader.new( path, more_attribs ) logger.info "parsing data '#{name}' (#{path})..." reader.each_line do |attribs, values| yield( attribs, values ) end ## fix: move Prop table to props gem - why? why not?? WorldDb::Models::Prop.create_from_fixture!( name, path ) end |