Sha256: 23fd4408f1e4aaf22ec87adecbc838053cd5eac2889771a5ebc30a15970b6a9b
Contents?: true
Size: 544 Bytes
Versions: 11
Compression:
Stored size: 544 Bytes
Contents
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
11 entries across 11 versions & 1 rubygems