Class: XTF::Search::Element::ResultData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = nil) ⇒ ResultData

Returns a new instance of ResultData.



5
6
7
8
# File 'lib/xtf/search/element/result_data.rb', line 5

def initialize(data=nil)
  @tag_name = "resultData"
  @value = data
end

Instance Attribute Details

#tag_nameObject (readonly)

Returns the value of attribute tag_name.



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

def tag_name
  @tag_name
end

#valueObject

Returns the value of attribute value.



2
3
4
# File 'lib/xtf/search/element/result_data.rb', line 2

def value
  @value
end

Instance Method Details

#to_xmlObject



15
16
17
# File 'lib/xtf/search/element/result_data.rb', line 15

def to_xml
  to_xml_node.to_s
end

#to_xml_nodeObject



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

def to_xml_node
  xml = XTF::XML::Element.new(self.tag_name)
  xml.text = self.value
  xml
end