/
atom_entry.rb
39 lines (35 loc) · 955 Bytes
/
atom_entry.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module Feedzirra
module Parser
# == Summary
# Parser for dealing with Atom feed entries.
#
# == Attributes
# * title
# * url
# * author
# * content
# * summary
# * published
# * categories
class AtomEntry
include SAXMachine
include FeedEntryUtilities
element :title
element :link, :as => :url, :value => :href, :with => {:type => "text/html", :rel => "alternate"}
element :name, :as => :author
element :content
element :summary
element :published
element :id, :as => :entry_id
element :created, :as => :published
element :issued, :as => :published
element :updated
element :modified, :as => :updated
elements :category, :as => :categories, :value => :term
elements :link, :as => :links, :value => :href
def url
@url || links.first
end
end
end
end