Class: SwedbankPay::SidebarPageTitle
- Inherits:
-
Object
- Object
- SwedbankPay::SidebarPageTitle
- Defined in:
- lib/sidebar_page_title.rb
Overview
Represents the title of a SidebarPage
Instance Attribute Summary collapse
-
#main ⇒ Object
readonly
Returns the value of attribute main.
-
#section ⇒ Object
readonly
Returns the value of attribute section.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#main ⇒ Object (readonly)
Returns the value of attribute main.
9 10 11 |
# File 'lib/sidebar_page_title.rb', line 9 def main @main end |
#section ⇒ Object (readonly)
Returns the value of attribute section.
9 10 11 |
# File 'lib/sidebar_page_title.rb', line 9 def section @section end |
Class Method Details
.parse(jekyll_page, sidebar_page) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sidebar_page_title.rb', line 11 def self.parse(jekyll_page, ) raise ArgumentError, 'jekyll_page cannot be nil' if jekyll_page.nil? raise ArgumentError, 'jekyll_page must be a Jekyll::Page' unless jekyll_page.is_a? Jekyll::Page raise ArgumentError, 'sidebar_page cannot be nil' if .nil? raise ArgumentError, 'sidebar_page must be a SidebarPage' unless .is_a? SidebarPage title = jekyll_page['title'] section = jekyll_page['section'] return nil if title.nil? && section.nil? SidebarPageTitle.new(title, section, ) end |
Instance Method Details
#<=>(other) ⇒ Object
40 41 42 43 44 |
# File 'lib/sidebar_page_title.rb', line 40 def <=>(other) return -1 if other.nil? @title <=> other.to_s end |
#inspect ⇒ Object
36 37 38 |
# File 'lib/sidebar_page_title.rb', line 36 def inspect @title end |
#lead ⇒ Object
25 26 27 28 29 30 |
# File 'lib/sidebar_page_title.rb', line 25 def lead section = find_section(@page) return section unless section.nil? @lead end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/sidebar_page_title.rb', line 32 def to_s @title end |