Class: Feedjira::Parser::ITunesRSS

Inherits:
Object
  • Object
show all
Includes:
FeedUtilities, SAXMachine
Defined in:
lib/feedjira/parser/itunes_rss.rb

Overview

iTunes is RSS 2.0 + some apple extensions Sources:

* https://cyber.harvard.edu/rss/rss.html
* http://lists.apple.com/archives/syndication-dev/2005/Nov/msg00002.html
* https://help.apple.com/itc/podcasts_connect/

Constant Summary

Constants included from FeedUtilities

FeedUtilities::UPDATABLE_ATTRIBUTES

Instance Attribute Summary collapse

Attributes included from FeedUtilities

#etag, #last_modified, #new_entries, #updated

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FeedUtilities

included, #new_entries?, #sanitize_entries!, #update_attribute, #update_from_feed, #updated?

Instance Attribute Details

#feed_urlObject

Returns the value of attribute feed_url


12
13
14
# File 'lib/feedjira/parser/itunes_rss.rb', line 12

def feed_url
  @feed_url
end

Class Method Details

.able_to_parse?(xml) ⇒ Boolean


63
64
65
# File 'lib/feedjira/parser/itunes_rss.rb', line 63

def self.able_to_parse?(xml)
  %r{xmlns:itunes\s?=\s?[\"\']http://www\.itunes\.com/dtds/podcast-1\.0\.dtd[\"\']}i =~ xml # rubocop:disable Metrics/LineLength
end

Instance Method Details

#itunes_categoriesObject


48
49
50
51
52
# File 'lib/feedjira/parser/itunes_rss.rb', line 48

def itunes_categories
  _itunes_categories.flat_map do |itunes_category|
    itunes_category.enum_for(:each_subcategory).to_a
  end
end

#itunes_category_pathsObject


54
55
56
57
58
# File 'lib/feedjira/parser/itunes_rss.rb', line 54

def itunes_category_paths
  _itunes_categories.flat_map do |itunes_category|
    itunes_category.enum_for(:each_path).to_a
  end
end