Class: Webgen::PathHandler::TipueSearch::Node
- Inherits:
-
PageUtils::Node
- Object
- PageUtils::Node
- Webgen::PathHandler::TipueSearch::Node
- Defined in:
- lib/webgen/bundle/tipue_search/tipue_search_path_handler.rb
Overview
Provides custom methods for tipue search nodes.
Instance Method Summary collapse
-
#entries ⇒ Object
Return the entries for the tipue search
node
. -
#text_for(node) ⇒ Object
Return the text content of the given node.
Instance Method Details
#entries ⇒ Object
Return the entries for the tipue search node
.
23 24 25 |
# File 'lib/webgen/bundle/tipue_search/tipue_search_path_handler.rb', line 23 def entries tree.website.ext.node_finder.find(node_info[:entries], self) end |
#text_for(node) ⇒ Object
Return the text content of the given node.
28 29 30 31 32 33 34 35 |
# File 'lib/webgen/bundle/tipue_search/tipue_search_path_handler.rb', line 28 def text_for(node) if tree.website.ext.destination.exists?(node.dest_path) Nokogiri::HTML(tree.website.ext.destination.read(node.dest_path)). css(self['content_css'] || 'body').text.gsub(/\s+/, ' ') else '' end end |