Class: AtomFeed::AtomText
Instance Method Summary collapse
-
#html? ⇒ Boolean
Entity escaped HTML.
-
#initialize(node) ⇒ AtomText
constructor
Initializes the text element.
-
#text? ⇒ Boolean
Plain text.
-
#to_s ⇒ Object
(also: #content)
Content of the text.
-
#type ⇒ Object
Determines how the information is encoded.
-
#xhtml? ⇒ Boolean
Inline XHTML.
Constructor Details
#initialize(node) ⇒ AtomText
Initializes the text element.
4 5 6 |
# File 'lib/atom_feed/atom_text.rb', line 4 def initialize(node) @node = node end |
Instance Method Details
#html? ⇒ Boolean
Entity escaped HTML
27 28 29 |
# File 'lib/atom_feed/atom_text.rb', line 27 def html? self.type == "html" end |
#text? ⇒ Boolean
Plain text
22 23 24 |
# File 'lib/atom_feed/atom_text.rb', line 22 def text? self.type == "text" end |
#to_s ⇒ Object Also known as: content
Content of the text
9 10 11 |
# File 'lib/atom_feed/atom_text.rb', line 9 def to_s @node.content end |
#type ⇒ Object
Determines how the information is encoded. Default is “text”
17 18 19 |
# File 'lib/atom_feed/atom_text.rb', line 17 def type @node["type"] || "text" end |
#xhtml? ⇒ Boolean
Inline XHTML
32 33 34 |
# File 'lib/atom_feed/atom_text.rb', line 32 def xhtml? self.type == "xhtml" end |