Sha256: e0cf783d420dcd5346ecd6cb44fe30c71ecdaa1480b2e67ed20add6a173885d4
Contents?: true
Size: 388 Bytes
Versions: 8
Compression:
Stored size: 388 Bytes
Contents
module Onebox class Matcher def initialize(link) @url = link end def ordered_engines @ordered_engines ||= Engine.engines.sort_by do |e| e.respond_to?(:priority) ? e.priority : 100 end end def oneboxed uri = URI(@url) ordered_engines.find { |engine| engine === uri } rescue URI::InvalidURIError nil end end end
Version data entries
8 entries across 8 versions & 1 rubygems