Sha256: d8061cc97b3f92a13219ddfb85b4ee3148afdb3f9c56433b6ee1779b768f59fa

Contents?: true

Size: 486 Bytes

Versions: 11

Compression:

Stored size: 486 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]}" #{Helpers.title_attr(oembed)}>
          </a>
        HTML
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
onebox-1.7.3 lib/onebox/engine/giphy_onebox.rb
onebox-1.7.2 lib/onebox/engine/giphy_onebox.rb
onebox-1.7.1 lib/onebox/engine/giphy_onebox.rb
onebox-1.7.0 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.9 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.8 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.7 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.6 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.5 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.4 lib/onebox/engine/giphy_onebox.rb
onebox-1.6.3 lib/onebox/engine/giphy_onebox.rb