Sha256: 07d7795d0a3249e07631e51af8c445121cedca747e8e1ba5e78b3183f044af87

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 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

1 entries across 1 versions & 1 rubygems

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