Sha256: 0864f887c42bc2c523eacedcfeed5dd58056e4a17585af264cf5c53776050f8b

Contents?: true

Size: 527 Bytes

Versions: 7

Compression:

Stored size: 527 Bytes

Contents

# frozen_string_literal: true

module Onebox
  module Engine
    class GiphyOnebox
      include Engine
      include StandardEmbed

      matches_regexp(/^https?:\/\/(giphy\.com\/gifs|gph\.is)\//)
      always_https

      def to_html
        oembed = get_oembed

        <<-HTML
          <a href="#{oembed.url}" target="_blank" rel="noopener" class="onebox">
            <img src="#{oembed.url}" width="#{oembed.width}" height="#{oembed.height}" #{oembed.title_attr}>
          </a>
        HTML
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
onebox-2.2.19 lib/onebox/engine/giphy_onebox.rb
onebox-2.2.18 lib/onebox/engine/giphy_onebox.rb
onebox-2.2.17 lib/onebox/engine/giphy_onebox.rb
onebox-2.2.16 lib/onebox/engine/giphy_onebox.rb
onebox-2.2.15 lib/onebox/engine/giphy_onebox.rb
onebox-2.2.14 lib/onebox/engine/giphy_onebox.rb
onebox-2.2.13 lib/onebox/engine/giphy_onebox.rb