# frozen_string_literal: true module Onebox module Engine class CloudAppOnebox include Engine include StandardEmbed matches_regexp(%r{^https?://cl\.ly}) always_https def to_html og = get_opengraph if !og.image.nil? image_html(og) elsif og.title.to_s[/\.(mp4|ogv|webm)$/] video_html(og) else link_html(og) end end private def link_html(og) <<-HTML #{og.title} HTML end def video_html(og) direct_src = ::Onebox::Helpers.normalize_url_for_output("#{og.get(:url)}/#{og.title}") <<-HTML HTML end def image_html(og) <<-HTML CloudApp HTML end end end end