Class: Feedjira::Parser::Atom
- Inherits:
-
Object
- Object
- Feedjira::Parser::Atom
- Includes:
- FeedUtilities, SAXMachine
- Defined in:
- lib/feedjira/parser/atom.rb
Overview
Parser for dealing with Atom feeds.
Constant Summary
Constants included from FeedUtilities
FeedUtilities::UPDATABLE_ATTRIBUTES
Instance Attribute Summary
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?
Class Method Details
.able_to_parse?(xml) ⇒ Boolean
17 18 19 |
# File 'lib/feedjira/parser/atom.rb', line 17 def self.able_to_parse?(xml) %r{\<feed[^\>]+xmlns\s?=\s?[\"\'](http://www\.w3\.org/2005/Atom|http://purl\.org/atom/ns\#)[\"\'][^\>]*\>} =~ xml # rubocop:disable Metrics/LineLength end |
.preprocess(xml) ⇒ Object
29 30 31 |
# File 'lib/feedjira/parser/atom.rb', line 29 def self.preprocess(xml) Preprocessor.new(xml).to_xml end |
Instance Method Details
#feed_url ⇒ Object
25 26 27 |
# File 'lib/feedjira/parser/atom.rb', line 25 def feed_url @feed_url ||= links.first end |
#url ⇒ Object
21 22 23 |
# File 'lib/feedjira/parser/atom.rb', line 21 def url @url || (links - [feed_url]).last || links.last end |