Class: SwedbankPay::SidebarParser
- Inherits:
-
Object
- Object
- SwedbankPay::SidebarParser
- Defined in:
- lib/sidebar_parser.rb
Overview
The Sidebar renderer
Instance Attribute Summary collapse
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
Instance Method Summary collapse
-
#initialize(site) ⇒ SidebarParser
constructor
A new instance of SidebarParser.
- #parse(tree) ⇒ Object
Constructor Details
#initialize(site) ⇒ SidebarParser
Returns a new instance of SidebarParser.
13 14 15 16 17 18 |
# File 'lib/sidebar_parser.rb', line 13 def initialize(site) raise ArgumentError, 'Site cannot be nil' if site.nil? raise ArgumentError, 'Site must be a Jekyll::Site' unless site.is_a? Jekyll::Site @pages = convert(site.pages) end |
Instance Attribute Details
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
11 12 13 |
# File 'lib/sidebar_parser.rb', line 11 def pages @pages end |
Instance Method Details
#parse(tree) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/sidebar_parser.rb', line 20 def parse(tree) raise ArgumentError, 'tree cannot be nil' if tree.nil? raise ArgumentError, 'tree must be a SidebarTreeBuilder' unless tree.is_a? SidebarTreeBuilder parse_html(tree) end |