Class | Atom::Text |
In: |
lib/atom/yaml.rb
lib/atom/text.rb |
Parent: | Atom::Element |
An Atom::Element representing a text construct. It has a single attribute, "type", which accepts values "text", "html" and "xhtml"
returns a string suitable for dumping into an HTML document
# File lib/atom/text.rb, line 32 32: def html 33: if self["type"] == "xhtml" or self["type"] == "html" 34: to_s 35: elsif self["type"] == "text" 36: REXML::Text.new(to_s).to_s 37: end 38: end
# File lib/atom/text.rb, line 23 23: def to_s 24: if self["type"] == "xhtml" 25: @content.children.to_s 26: else 27: @content.to_s 28: end 29: end
attepts to parse the content and return it as an array of REXML::Elements
# File lib/atom/text.rb, line 41 41: def xml 42: if self["type"] == "xhtml" 43: @content.children 44: elsif self["type"] == "text" 45: [self.to_s] 46: else 47: # XXX - hpricot goes here? 48: raise "I haven't implemented this yet" 49: end 50: end