lib/feedjira/parser/atom_feed_burner.rb in feedjira-2.1.1 vs lib/feedjira/parser/atom_feed_burner.rb in feedjira-2.1.2

- old
+ new

@@ -15,23 +15,25 @@ element :"atom10:link", as: :feed_url_atom10_link, value: :href, with: { type: 'application/atom+xml' } elements :"atom10:link", as: :hubs, value: :href, with: { rel: 'hub' } elements :entry, as: :entries, class: AtomFeedBurnerEntry + attr_writer :url, :feed_url + def self.able_to_parse?(xml) ((/Atom/ =~ xml) && (/feedburner/ =~ xml) && !(/\<rss|\<rdf/ =~ xml)) || false # rubocop:disable Metrics/LineLength end # Feed url is <link> with type="text/html" if present, # <link> with no type attribute otherwise def url - @url_text_html || url_notype + @url || @url_text_html || @url_notype end # Feed feed_url is <link> with type="application/atom+xml" if present, # <atom10:link> with type="application/atom+xml" otherwise def feed_url - @feed_url_link || feed_url_atom10_link + @feed_url || @feed_url_link || @feed_url_atom10_link end def self.preprocess(xml) Preprocessor.new(xml).to_xml end