Sha256: caee38c7644b1068a161151c7c0768c0e9ec77962c59908349c7a7e3a6e3c1bc

Contents?: true

Size: 482 Bytes

Versions: 9

Compression:

Stored size: 482 Bytes

Contents

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

9 entries across 9 versions & 1 rubygems

Version Path
onebox-1.8.89 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.88 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.87 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.86 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.85 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.84 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.83 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.82 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.80 lib/onebox/engine/giphy_onebox.rb