Module: Feedjira::RSSEntryUtilities

Included in:
Parser::ITunesRSSItem, Parser::RSSEntry, Parser::RSSFeedBurnerEntry
Defined in:
lib/feedjira/rss_entry_utilities.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object


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
# File 'lib/feedjira/rss_entry_utilities.rb', line 5

def self.included(mod)
  mod.class_exec do
    element :title

    element :"content:encoded", as: :content
    element :"a10:content", as: :content
    element :description, as: :summary

    element :link, as: :url
    element :"a10:link", as: :url, value: :href

    element :author
    element :"dc:creator", as: :author
    element :"a10:name", as: :author

    element :pubDate, as: :published
    element :pubdate, as: :published
    element :issued, as: :published
    element :"dc:date", as: :published
    element :"dc:Date", as: :published
    element :"dcterms:created", as: :published

    element :"dcterms:modified", as: :updated
    element :"a10:updated", as: :updated

    element :guid, as: :entry_id, class: Feedjira::Parser::GloballyUniqueIdentifier
    element :"dc:identifier", as: :dc_identifier

    element :"media:thumbnail", as: :image, value: :url
    element :"media:content", as: :image, value: :url
    element :enclosure, as: :image, value: :url

    elements :category, as: :categories
  end
end

Instance Method Details

#entry_idObject


41
42
43
# File 'lib/feedjira/rss_entry_utilities.rb', line 41

def entry_id
  @entry_id&.guid
end

#idObject


49
50
51
# File 'lib/feedjira/rss_entry_utilities.rb', line 49

def id
  entry_id || @dc_identifier || @url
end

#urlObject


45
46
47
# File 'lib/feedjira/rss_entry_utilities.rb', line 45

def url
  @url || @entry_id&.url
end