Class: PfrpgImport::HeroclassImporter
- Inherits:
-
Object
- Object
- PfrpgImport::HeroclassImporter
- Defined in:
- lib/pfrpg_import/heroclass_importer.rb
Instance Attribute Summary collapse
-
#facts ⇒ Object
readonly
Returns the value of attribute facts.
-
#levels ⇒ Object
readonly
Returns the value of attribute levels.
-
#spells ⇒ Object
readonly
Returns the value of attribute spells.
Instance Method Summary collapse
- #import_heroclass ⇒ Object
-
#initialize(filename, path = nil) ⇒ HeroclassImporter
constructor
A new instance of HeroclassImporter.
- #write_feature_file ⇒ Object
- #write_heroclass_file ⇒ Object
- #write_level_table ⇒ Object
- #write_spell_file ⇒ Object
Constructor Details
#initialize(filename, path = nil) ⇒ HeroclassImporter
Returns a new instance of HeroclassImporter.
7 8 9 10 11 12 13 14 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 7 def initialize(filename, path=nil) @csv = CSV.read(filename) @path = path parser = HeroclassParser.new(@csv) @levels = parser.levels @facts = parser.facts @spells = parser.spells end |
Instance Attribute Details
#facts ⇒ Object (readonly)
Returns the value of attribute facts.
6 7 8 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 6 def facts @facts end |
#levels ⇒ Object (readonly)
Returns the value of attribute levels.
6 7 8 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 6 def levels @levels end |
#spells ⇒ Object (readonly)
Returns the value of attribute spells.
6 7 8 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 6 def spells @spells end |
Instance Method Details
#import_heroclass ⇒ Object
16 17 18 19 20 21 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 16 def import_heroclass write_level_table write_heroclass_file write_feature_file write_spell_file end |
#write_feature_file ⇒ Object
33 34 35 36 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 33 def write_feature_file feature = FeatureWriter.new(@facts, @facts.title, @path) feature.print_features end |
#write_heroclass_file ⇒ Object
28 29 30 31 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 28 def write_heroclass_file heroclass = HeroclassWriter.new(@facts, @facts.title, @path) heroclass.print_class end |
#write_level_table ⇒ Object
23 24 25 26 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 23 def write_level_table table = LevelWriter.new(@levels, @facts.title, @path) table.print_class end |
#write_spell_file ⇒ Object
38 39 40 41 |
# File 'lib/pfrpg_import/heroclass_importer.rb', line 38 def write_spell_file spell = SpellWriter.new(@spells, @facts.title, @path) spell.print_spells end |