class Muwu::RenderHtmlPartialBuilder::NavigatorBuilder

Attributes

project[RW]
renderer[RW]

Public Class Methods

build() { |builder| ... } click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 15
def self.build
  builder = new
  yield(builder)
  builder.renderer
end
new() click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 22
def initialize
  @renderer = RenderHtmlPartial::Navigator.new
end

Public Instance Methods

build_from_manifest_task_navigator(navigator) click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 27
def build_from_manifest_task_navigator(navigator)
  @navigator = navigator
  @project = navigator.project
  set_destination
  set_heading
  set_href_document_home
  set_href_document_next
  set_href_document_prev
end
set_destination() click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 38
def set_destination
  @renderer.destination = @navigator.destination
end
set_heading() click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 43
def set_heading
  @renderer.heading = @navigator.heading
end
set_href_document_home() click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 48
def set_href_document_home
  @renderer.href_document_home  = determine_href_by_index(@navigator.document_home_index)
end
set_href_document_next() click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 53
def set_href_document_next
  @renderer.href_document_next  = determine_href_by_index(@navigator.document_next_index)
end
set_href_document_prev() click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 58
def set_href_document_prev
  @renderer.href_document_prev  = determine_href_by_index(@navigator.document_prev_index)
end

Private Instance Methods

determine_href_by_index(index) click to toggle source
# File lib/muwu/render_html_partial_builder/render_navigator_builder.rb, line 67
def determine_href_by_index(index)
  @project.manifest.find_document_html_by_index(index).destination.output_filename
end