Class: XTF::Search::Element::SectionType

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content = nil) ⇒ SectionType

Returns a new instance of SectionType.



6
7
8
9
# File 'lib/xtf/search/element/section_type.rb', line 6

def initialize(content = nil)
  @tag_name = "sectionType"
  @content = content
end

Instance Attribute Details

#contentObject

one Term or Clause



3
4
5
# File 'lib/xtf/search/element/section_type.rb', line 3

def content
  @content
end

#tag_nameObject (readonly)

Returns the value of attribute tag_name.



4
5
6
# File 'lib/xtf/search/element/section_type.rb', line 4

def tag_name
  @tag_name
end

Instance Method Details

#to_xmlObject



16
17
18
# File 'lib/xtf/search/element/section_type.rb', line 16

def to_xml
  to_xml_node.to_s
end

#to_xml_nodeObject



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

def to_xml_node
  xml = XTF::XML::Element.new("sectionType")
  xml.add_element(self.content.to_xml_node) if self.content
  xml
end