# frozen_string_literal: true module Onebox module Engine class RedditMediaOnebox include Engine include StandardEmbed matches_regexp(%r{^https?://(www\.)?reddit\.com}) def to_html if raw[:type] == "image" <<-HTML HTML elsif raw[:type] =~ %r{^video[/\.]} <<-HTML HTML else html = Onebox::Engine::AllowlistedGenericOnebox.new(@url, @timeout).to_html html.presence end end end end end