Class: Spix::Parser::Atom

Inherits:
Object show all
Includes:
Feedzirra::FeedUtilities, SAXMachine
Defined in:
lib/spix_parser/custom_parsers/atom.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.able_to_parse?(xml) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


19
20
21
# File 'lib/spix_parser/custom_parsers/atom.rb', line 19

def self.able_to_parse?(xml) #:nodoc:
  (xml =~ /application\/atom\+xml|(#{Regexp.escape("http://www.w3.org/2005/Atom")})|(#{Regexp.escape("http://purl.org/atom")})/) && (xml =~ /\<feed\s/)
end

Instance Method Details

#feed_urlObject



27
28
29
# File 'lib/spix_parser/custom_parsers/atom.rb', line 27

def feed_url
  @feed_url || links.first
end

#last_modifiedObject



31
32
33
# File 'lib/spix_parser/custom_parsers/atom.rb', line 31

def last_modified
  @last_modified.present? ? @last_modified : super
end

#urlObject



23
24
25
# File 'lib/spix_parser/custom_parsers/atom.rb', line 23

def url
  @url || links.last
end