Class: Webgen::PathHandler::TipueSearch::Node

Inherits:
PageUtils::Node
  • Object
show all
Defined in:
lib/webgen/bundle/tipue_search/tipue_search_path_handler.rb

Overview

Provides custom methods for tipue search nodes.

Instance Method Summary collapse

Instance Method Details

#entriesObject

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