Class: AtomFeed::AtomText

Inherits:
Object show all
Defined in:
lib/atom_feed/atom_text.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


27
28
29
# File 'lib/atom_feed/atom_text.rb', line 27

def html?
  self.type == "html"
end

#text?Boolean

Plain text

Returns:

  • (Boolean)


22
23
24
# File 'lib/atom_feed/atom_text.rb', line 22

def text?
  self.type == "text"
end

#to_sObject 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

#typeObject

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

Returns:

  • (Boolean)


32
33
34
# File 'lib/atom_feed/atom_text.rb', line 32

def xhtml?
  self.type == "xhtml"
end