Class: XTF::Search::Element::AllDocs

Inherits:
Object
  • Object
show all
Defined in:
lib/xtf/search/element/all_docs.rb

Overview

This class is used inside a Query to retrieve all docs. It’s primary purpose is for use with Facets:

query = Query.new
query.content << AllDocs.new
query.content << Facet.new('word')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAllDocs

Returns a new instance of AllDocs.



12
13
14
15
# File 'lib/xtf/search/element/all_docs.rb', line 12

def initialize
  @tag_name = "all_docs"
  super
end

Instance Attribute Details

#tag_nameObject (readonly)

Returns the value of attribute tag_name.



10
11
12
# File 'lib/xtf/search/element/all_docs.rb', line 10

def tag_name
  @tag_name
end

Instance Method Details

#to_xmlObject



20
21
22
# File 'lib/xtf/search/element/all_docs.rb', line 20

def to_xml
  to_xml_node.to_s
end

#to_xml_nodeObject



17
18
19
# File 'lib/xtf/search/element/all_docs.rb', line 17

def to_xml_node
  XTF::XML::Element.new(self.tag_name.to_s.camelize(:lower))
end