Class: Atom::Content

Inherits:
Object
  • Object
show all
Defined in:
lib/atom.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Base, External, Html, Text, Xhtml

Constant Summary

PARSERS =
{'html' => Html, 'xhtml' => Xhtml}

Class Method Summary collapse

Class Method Details

.parse(xml) ⇒ Object



172
173
174
175
176
177
178
179
# File 'lib/atom.rb', line 172

def self.parse(xml)
  if xml['src'] && !xml['src'].empty?
    External.new(xml)
  else
    parser = PARSERS[xml['type']] || Text
    parser.new(xml)
  end
end