Sha256: ac7ab7af14ef47fb3626feef7d3346ba0515a371f27ddb152c23a7dd2e9a3578
Contents?: true
Size: 591 Bytes
Versions: 7
Compression:
Stored size: 591 Bytes
Contents
# -*- encoding: utf-8 -*- module Genit # Modify menu links. class MenuBuilder < BuilderBase # Public: Build the menu of a particular page. # # page_name - The string filename of the page to build menu for. # # Returns the modified Nokogiri::XML::Document def build_for_page page_name build page_name, menu_links end private def menu_links @document.css("ul#menu a") end def update link @path = link['href'] link['id'] = 'selected' if @path == @page_name.force_html_extension end end end
Version data entries
7 entries across 7 versions & 1 rubygems