Class: SwedbankPay::SidebarTreeBuilder

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/sidebar_tree_builder.rb

Overview

Arranges Sidebar pages into a tree

Instance Method Summary collapse

Constructor Details

#initialize(pages) ⇒ SidebarTreeBuilder

Returns a new instance of SidebarTreeBuilder.

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
# File 'lib/sidebar_tree_builder.rb', line 14

def initialize(pages)
  raise ArgumentError, 'pages cannot be nil' if pages.nil?
  raise ArgumentError, 'pages must be a Hash' unless pages.is_a? Hash

  @tree = tree(pages)
  enrich_jekyll_pages(@tree)
end

Instance Method Details

#inspectObject



26
27
28
# File 'lib/sidebar_tree_builder.rb', line 26

def inspect
  stringify(inspection: true)
end

#to_sObject



22
23
24
# File 'lib/sidebar_tree_builder.rb', line 22

def to_s
  stringify
end