Sha256: 6933ff4534fd3f5bab9f1de2536c535ad0f34a01243f0b9859dd4ce3166c2e52

Contents?: true

Size: 456 Bytes

Versions: 1

Compression:

Stored size: 456 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">
            <img src="#{oembed[:image]}" width="#{oembed[:width]}" height="#{oembed[:height]}">
          </a>
        HTML
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.6.2 lib/onebox/engine/giphy_onebox.rb