Sha256: bffcad539ba4d5e140dfa10c28a5e07b86d30563af7167a504570d0679bdc9fa

Contents?: true

Size: 437 Bytes

Versions: 3

Compression:

Stored size: 437 Bytes

Contents

module Onebox
  module Engine
    class GiphyOnebox
      include Engine
      include StandardEmbed

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

      def to_html
        oembed = get_oembed

        <<-HTML
          <a href="#{oembed[:url]}" target="_blank">
            <img src="#{oembed[:image]}" width="#{oembed[:width]}" height="#{oembed[:height]}">
          </a>
        HTML
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
onebox-1.6.1 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.0 lib/onebox/engine/giphy_onebox.rb
onebox-1.5.65 lib/onebox/engine/giphy_onebox.rb