Class: XTF::Search::Element::ResultData
- Inherits:
-
Object
- Object
- XTF::Search::Element::ResultData
- Defined in:
- lib/xtf/search/element/result_data.rb
Instance Attribute Summary collapse
-
#tag_name ⇒ Object
readonly
Returns the value of attribute tag_name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data = nil) ⇒ ResultData
constructor
A new instance of ResultData.
- #to_xml ⇒ Object
- #to_xml_node ⇒ Object
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_name ⇒ Object (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 |
#value ⇒ Object
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_xml ⇒ Object
15 16 17 |
# File 'lib/xtf/search/element/result_data.rb', line 15 def to_xml to_xml_node.to_s end |
#to_xml_node ⇒ Object
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 |