Class: SwedbankPay::SidebarRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/sidebar_renderer.rb

Overview

Renders the Sidebar

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ SidebarRenderer

Returns a new instance of SidebarRenderer.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
# File 'lib/sidebar_renderer.rb', line 9

def initialize(tree)
  raise ArgumentError, 'pages cannot be nil' if tree.nil?
  raise ArgumentError, 'pages must be an SidebarTreeBuilder' unless tree.is_a? SidebarTreeBuilder

  @tree = tree
  @html_builder = SidebarHTMLBuilder.new(@tree)
end

Instance Method Details

#enrich_jekyllObject



17
18
19
# File 'lib/sidebar_renderer.rb', line 17

def enrich_jekyll
  enrich_jekyll_pages(@tree)
end

#renderObject



21
22
23
# File 'lib/sidebar_renderer.rb', line 21

def render
  render_pages(@tree)
end