Class: JekyllNavigation::AbstractNavigationItem

Inherits:
Struct
  • Object
show all
Defined in:
lib/jekyll-navigation/navigation_item.rb

Direct Known Subclasses

CurrentNavigationItem, NavigationItem

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pageObject

Returns the value of attribute page

Returns:

  • (Object)

    the current value of page



2
3
4
# File 'lib/jekyll-navigation/navigation_item.rb', line 2

def page
  @page
end

Instance Method Details

#[](key) ⇒ Object



3
4
5
# File 'lib/jekyll-navigation/navigation_item.rb', line 3

def [] key
  page[key]
end

#exclude?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/jekyll-navigation/navigation_item.rb', line 21

def exclude?
  fetch_navigation_property('exclude') { false }
end

#orderObject



17
18
19
# File 'lib/jekyll-navigation/navigation_item.rb', line 17

def order
  fetch_navigation_property('order') { -1 }
end

#parentObject



13
14
15
# File 'lib/jekyll-navigation/navigation_item.rb', line 13

def parent
  fetch_navigation_property('parent') { nil }
end

#titleObject



7
8
9
10
11
# File 'lib/jekyll-navigation/navigation_item.rb', line 7

def title
  fetch_navigation_property('title') do
    self["title"] || File.basename(self["name"], File.extname(self["name"]))
  end
end