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

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



195
196
197
# File 'lib/atom.rb', line 195

def initialize(c)
  __setobj__(c)
end

Instance Method Details

#==(o) ⇒ Object



199
200
201
202
203
204
205
206
207
# File 'lib/atom.rb', line 199

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