Sha256: f49454c14b9d6dd655e7832f2df8a647dcea70f1fe7356d3ed5a6bd96e647fee
Contents?: true
Size: 1.26 KB
Versions: 2
Compression:
Stored size: 1.26 KB
Contents
# coding: utf-8 ################################################ # © Alexander Semyonov, 2011—2013, MIT License # # Author: Alexander Semyonov <al@semyonov.us> # ################################################ require 'xommelier/atom' module Xommelier module Atom # Implments Atom Threading Extensions # See RFC 4685 {http://tools.ietf.org/html/rfc4685.html} module Threading include Xommelier::Xml xmlns 'http://purl.org/syndication/thread/1.0', as: :thr class InReplyTo < Xml::Element element_name 'in-reply-to' attribute :ref may do attribute :href, type: Uri attribute :type, type: String attribute :source end end end # Extends Atom elements class Entry may do element :in_reply_to, type: Threading::InReplyTo, as: Threading::InReplyTo.element_name element :total, type: Integer, ns: Threading.xmlns end def replies_feed_url links.find { |link| link.rel == 'replies' && link.type == 'application/atom+xml' }.try(:href) end end class Link may do attribute :count, type: Integer, ns: Threading.xmlns attribute :updated, type: Time, ns: Threading.xmlns end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
xommelier-0.1.32 | lib/xommelier/atom/threading.rb |
xommelier-0.1.31 | lib/xommelier/atom/threading.rb |