Sha256: 8b6be068b2038386120312793677836d05cdd4b56a13142c7b1f5c357cc03334

Contents?: true

Size: 850 Bytes

Versions: 22

Compression:

Stored size: 850 Bytes

Contents

require 'xommelier/atom'

module Xommelier
  module Atom
    # Implements Feed Paging and Archiving
    # See RFC 5005 {http://tools.ietf.org/html/rfc5005.html}
    module History
      include Xommelier::Xml

      xmlns 'http://purl.org/syndication/history/1.0', as: :fh

      class Complete < Xml::Element; end
      class Archive < Xml::Element; end
    end

    class Feed
      may do
        element :complete, type: History::Complete
        element :archive, type: History::Archive
      end

      alias complete? complete
      alias archive? archive

      %w(first last previous next
         prev-archive next-archive current).each do |rel|
        define_method(:"#{rel.underscore}_feed_url") do
          links.find { |link| link.rel == rel && link.type == 'application/atom+xml' }.try(:href)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
xommelier-0.1.30 lib/xommelier/atom/history.rb
xommelier-0.1.29 lib/xommelier/atom/history.rb
xommelier-0.1.28 lib/xommelier/atom/history.rb
xommelier-0.1.27 lib/xommelier/atom/history.rb
xommelier-0.1.26 lib/xommelier/atom/history.rb
xommelier-0.1.25 lib/xommelier/atom/history.rb
xommelier-0.1.24 lib/xommelier/atom/history.rb
xommelier-0.1.23 lib/xommelier/atom/history.rb
xommelier-0.1.22 lib/xommelier/atom/history.rb
xommelier-0.1.21 lib/xommelier/atom/history.rb
xommelier-0.1.20 lib/xommelier/atom/history.rb
xommelier-0.1.19 lib/xommelier/atom/history.rb
xommelier-0.1.18 lib/xommelier/atom/history.rb
xommelier-0.1.16 lib/xommelier/atom/history.rb
xommelier-0.1.15 lib/xommelier/atom/history.rb
xommelier-0.1.14 lib/xommelier/atom/history.rb
xommelier-0.1.13 lib/xommelier/atom/history.rb
xommelier-0.1.12 lib/xommelier/atom/history.rb
xommelier-0.1.11 lib/xommelier/atom/history.rb
xommelier-0.1.10 lib/xommelier/atom/history.rb