Class: Bookbinder::Subnav::JsonPropsCreator
- Inherits:
-
Object
- Object
- Bookbinder::Subnav::JsonPropsCreator
- Defined in:
- lib/bookbinder/subnav/json_props_creator.rb
Instance Attribute Summary collapse
-
#fs ⇒ Object
readonly
Returns the value of attribute fs.
-
#json_generator ⇒ Object
readonly
Returns the value of attribute json_generator.
-
#output_locations ⇒ Object
readonly
Returns the value of attribute output_locations.
Instance Method Summary collapse
- #create(subnav_spec) ⇒ Object
-
#initialize(fs, output_locations, json_generator) ⇒ JsonPropsCreator
constructor
A new instance of JsonPropsCreator.
Constructor Details
#initialize(fs, output_locations, json_generator) ⇒ JsonPropsCreator
Returns a new instance of JsonPropsCreator.
4 5 6 7 8 |
# File 'lib/bookbinder/subnav/json_props_creator.rb', line 4 def initialize(fs, output_locations, json_generator) @fs = fs @output_locations = output_locations @json_generator = json_generator end |
Instance Attribute Details
#fs ⇒ Object (readonly)
Returns the value of attribute fs.
18 19 20 |
# File 'lib/bookbinder/subnav/json_props_creator.rb', line 18 def fs @fs end |
#json_generator ⇒ Object (readonly)
Returns the value of attribute json_generator.
18 19 20 |
# File 'lib/bookbinder/subnav/json_props_creator.rb', line 18 def json_generator @json_generator end |
#output_locations ⇒ Object (readonly)
Returns the value of attribute output_locations.
18 19 20 |
# File 'lib/bookbinder/subnav/json_props_creator.rb', line 18 def output_locations @output_locations end |
Instance Method Details
#create(subnav_spec) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/bookbinder/subnav/json_props_creator.rb', line 10 def create() json_links = json_generator.get_links(, output_locations) fs.write(text: json_links, to: props_path(.)) filename(.) end |