Sha256: 732989c0ffb50bfdf57888b749ee05a0a05f62b07a48e2649e2d1e245743cb9f

Contents?: true

Size: 746 Bytes

Versions: 5

Compression:

Stored size: 746 Bytes

Contents

require 'xommelier/atom'

module Xommelier
  module Atom
    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

5 entries across 5 versions & 1 rubygems

Version Path
xommelier-0.1.7 lib/xommelier/atom/history.rb
xommelier-0.1.6 lib/xommelier/atom/history.rb
xommelier-0.1.5 lib/xommelier/atom/history.rb
xommelier-0.1.4 lib/xommelier/atom/history.rb
xommelier-0.1.3 lib/xommelier/atom/history.rb