Class: Atom::Content::Text
Overview
Text content within an Atom document.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Text
constructor
A new instance of Text.
- #to_xml(nodeonly = true, name = 'content', namespace = nil, namespace_map = Atom::Xml::NamespaceMap.new) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(xml) ⇒ Text
Returns a new instance of Text.
206 207 208 209 |
# File 'lib/atom.rb', line 206 def initialize(xml) super(xml.read_string) parse(xml, :once => true) end |
Instance Method Details
#to_xml(nodeonly = true, name = 'content', namespace = nil, namespace_map = Atom::Xml::NamespaceMap.new) ⇒ Object
211 212 213 214 215 |
# File 'lib/atom.rb', line 211 def to_xml(nodeonly = true, name = 'content', namespace = nil, namespace_map = Atom::Xml::NamespaceMap.new) node = XML::Node.new("#{namespace_map.get(Atom::NAMESPACE)}:#{name}") node << self.to_s node end |