Sha256: 1cecc9499569c6c96bb82e6c6e17abddf5f542d5f76a01a3368d74fbefcde1d4

Contents?: true

Size: 513 Bytes

Versions: 38

Compression:

Stored size: 513 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" class="onebox">
            <img src="#{oembed.url}" width="#{oembed.width}" height="#{oembed.height}" #{oembed.title_attr}>
          </a>
        HTML
      end

    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
onebox-1.9.27.1 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.26 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.25 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.24 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.23 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.22 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.21 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.20 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.19 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.18 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.17 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.16 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.15 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.14 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.13 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.12 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.11 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.10 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.9 lib/onebox/engine/giphy_onebox.rb
onebox-1.9.8 lib/onebox/engine/giphy_onebox.rb