lib/atom/entry.rb in atom-tools-0.9.0 vs lib/atom/entry.rb in atom-tools-0.9.1
- old
+ new
@@ -53,23 +53,30 @@
# XXX I don't think I've ever actually used this
yield self if block_given?
end
- # parses XML fetched from +base+ into an Atom::Entry
+ # parses XML into an Atom::Entry
+ #
+ # +base+ is the absolute URI the document was fetched from
+ # (if there is one)
def self.parse xml, base = ""
if xml.respond_to? :to_atom_entry
xml.to_atom_entry(base)
+ elsif xml.respond_to? :read
+ self.parse(xml.read)
else
REXML::Document.new(xml.to_s).to_atom_entry(base)
end
end
def inspect # :nodoc:
"#<Atom::Entry id:'#{self.id}'>"
end
- # declare that this entry has updated
+ # declare that this entry has updated.
+ #
+ # (note that this is different from Atom::Feed#update!)
def updated!
self.updated = Time.now
end
# categorize the entry based on a space-separated string