Class: Bookwatch::Subnav::SubnavGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/bookwatch/subnav/subnav_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(navigation_entries_parser, template_creator, pdf_config_creator, output_locations) ⇒ SubnavGenerator

Returns a new instance of SubnavGenerator.



4
5
6
7
8
9
# File 'lib/bookwatch/subnav/subnav_generator.rb', line 4

def initialize(navigation_entries_parser, template_creator, pdf_config_creator, output_locations)
  @navigation_entries_parser = navigation_entries_parser
  @template_creator = template_creator
  @pdf_config_creator = pdf_config_creator
  @output_locations = output_locations
end

Instance Attribute Details

Returns the value of attribute navigation_entries_parser.



17
18
19
# File 'lib/bookwatch/subnav/subnav_generator.rb', line 17

def navigation_entries_parser
  @navigation_entries_parser
end

#pdf_config_creatorObject (readonly)

Returns the value of attribute pdf_config_creator.



17
18
19
# File 'lib/bookwatch/subnav/subnav_generator.rb', line 17

def pdf_config_creator
  @pdf_config_creator
end

#template_creatorObject (readonly)

Returns the value of attribute template_creator.



17
18
19
# File 'lib/bookwatch/subnav/subnav_generator.rb', line 17

def template_creator
  @template_creator
end

Instance Method Details

#generate(subnav_spec) ⇒ Object



11
12
13
14
15
# File 'lib/bookwatch/subnav/subnav_generator.rb', line 11

def generate(subnav_spec)
  navigation_entries = navigation_entries_parser.get_links(subnav_spec, output_locations)
  template_creator.create(navigation_entries, subnav_spec)
  pdf_config_creator.create(navigation_entries, subnav_spec) if pdf?(subnav_spec)
end