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

External, Html, Text, Xhtml

Instance Method Summary collapse

Methods included from Xml::Parseable

#accessor_name, #current_node_is?, included, #next_node_is?, #parse, #to_xml

Methods inherited from String

#constantize, #demodulize, #singularize

Constructor Details

#initialize(c) ⇒ Base

Returns a new instance of Base.



199
200
201
# File 'lib/atom.rb', line 199

def initialize(c)
  __setobj__(c)
end

Instance Method Details

#==(o) ⇒ Object



203
204
205
206
207
208
209
210
211
# File 'lib/atom.rb', line 203

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