Class: Bookbinder::Subnav::PdfConfigCreator
- Inherits:
-
Object
- Object
- Bookbinder::Subnav::PdfConfigCreator
- Defined in:
- lib/bookbinder/subnav/pdf_config_creator.rb
Instance Attribute Summary collapse
-
#fs ⇒ Object
readonly
Returns the value of attribute fs.
-
#output_locations ⇒ Object
readonly
Returns the value of attribute output_locations.
Instance Method Summary collapse
- #create(props_filename, subnav_config) ⇒ Object
-
#initialize(fs, output_locations) ⇒ PdfConfigCreator
constructor
A new instance of PdfConfigCreator.
Constructor Details
#initialize(fs, output_locations) ⇒ PdfConfigCreator
Returns a new instance of PdfConfigCreator.
7 8 9 10 |
# File 'lib/bookbinder/subnav/pdf_config_creator.rb', line 7 def initialize(fs, output_locations) @fs = fs @output_locations = output_locations end |
Instance Attribute Details
#fs ⇒ Object (readonly)
Returns the value of attribute fs.
20 21 22 |
# File 'lib/bookbinder/subnav/pdf_config_creator.rb', line 20 def fs @fs end |
#output_locations ⇒ Object (readonly)
Returns the value of attribute output_locations.
20 21 22 |
# File 'lib/bookbinder/subnav/pdf_config_creator.rb', line 20 def output_locations @output_locations end |
Instance Method Details
#create(props_filename, subnav_config) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/bookbinder/subnav/pdf_config_creator.rb', line 12 def create(props_filename, ) json = JSON.parse(fs.read(props_location(props_filename))) @links = format_links(json['links']) fs.overwrite(to: output_locations.pdf_config_dir.join(.pdf_config), text: config_content) end |