Sha256: 8f360e3e09ba6fa7597f0beeebb220e6d7fea9a718c720e29abdf8f79bb8fdb6

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

module Feedzirra
  # == Summary
  # Parser for dealing with Atom feeds.
  #
  # == Attributes
  # * prev_page
  # * next_page
  # * last_page
  # * title
  # * subtitle
  # * updated
  # * feed_url
  # * url
  # * related
  # * entries
  class Atom
    include SAXMachine
    include FeedUtilities
    element :"atom:link", :as => :prev_page, :value => :href, :with => {:rel => 'prev'}
    element :"atom:link", :as => :next_page, :value => :href, :with => {:rel => 'next'}
    element :"atom:link", :as => :last_page, :value => :href, :with => {:rel => 'last'}
    element :title
    element :subtitle
    element :updated
    element :link, :as => :url, :value => :href, :with => {:type => "text/html"}
    element :link, :as => :feed_url, :value => :href, :with => {:type => "application/atom+xml"}
    elements :link, :as => :related, :value => :href, :with => {:rel => "related"}

    elements :entry, :as => :entries, :class => AtomEntry

    def self.able_to_parse?(xml) #:nodoc:
      xml =~ /(Atom)|(#{Regexp.escape("http://purl.org/atom")})/
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kete-feedzirra-0.0.8.1 lib/feedzirra/atom.rb
kete-feedzirra-0.0.8 lib/feedzirra/atom.rb