Sha256: 657bf6365e0b7ecf5b6f2d0eb661d49fb69c410a70ec74216094e7c23f8af4f4
Contents?: true
Size: 775 Bytes
Versions: 1
Compression:
Stored size: 775 Bytes
Contents
# frozen_string_literal: true ################################################ # © Alexander Semyonov, 2011—2013, MIT License # # Author: Alexander Semyonov <al@semyonov.us> # ################################################ require 'xommelier/atom' module Xommelier module Atom module LinksExtension def feed_url detect_linked_href(rel: 'self', type: 'application/atom+xml') end def html_url detect_linked_href(rel: 'alternate', type: 'text/html') end protected def detect_linked_href(attributes = {}) links.detect do |link| attributes.inject(true) do |result, (attr, value)| result && link.send(attr) == value end end.try(:href) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
xommelier-0.1.35 | lib/xommelier/atom/links_extension.rb |