Class: Atom::Content::Base

Inherits:
String
  • Object
show all
Includes:
Xml::Parseable
Defined in:
lib/atom.rb

Overview

This is the base class for all content within an atom document.

Content can be Text, Html or Xhtml.

A Content object can be treated as a String with type and xml_lang attributes.

For a thorough discussion of atom content see www.atomenabled.org/developers/syndication/atom-format-spec.php#element.content

Direct Known Subclasses

Html, Text, Xhtml

Instance Method Summary collapse

Constructor Details

#initialize(c) ⇒ Base

Returns a new instance of Base.



183
184
185
# File 'lib/atom.rb', line 183

def initialize(c)
  __setobj__(c)
end

Instance Method Details

#==(o) ⇒ Object



187
188
189
190
191
192
193
194
195
# File 'lib/atom.rb', line 187

def ==(o)
  if o.is_a?(self.class)
    self.type == o.type &&
     self.xml_lang == o.xml_lang &&
     self.to_s == o.to_s
  elsif o.is_a?(String)
    self.to_s == o
  end
end