Sha256: 42b396b524058ef203a9f126f9222699b41e5a2f3a9b4e3d738b24aa62d8c883

Contents?: true

Size: 510 Bytes

Versions: 23

Compression:

Stored size: 510 Bytes

Contents

module OEmbed
  class Response
    # A Response used for representing static photos.
    class Photo < self
      # Returns an <img> tag pointing at the appropraite URL.
      def html
        "<img src='#{self.url}' alt='#{(self.respond_to?(:title) ? self.title : nil)}' />"
      end
      
      private
      
      # See {section 2.3.4.1 of the oEmbed spec}[http://oembed.com/#section2.3]
      def must_override
        %w{
          url width height
        } + super
      end
      
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
ruby-oembed-0.18.1 lib/oembed/response/photo.rb
ruby-oembed-0.18.0 lib/oembed/response/photo.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/ruby-oembed-0.17.0/lib/oembed/response/photo.rb
ruby-oembed-0.17.0 lib/oembed/response/photo.rb
ruby-oembed-0.16.1 lib/oembed/response/photo.rb
ruby-oembed-0.16.0 lib/oembed/response/photo.rb
ruby-oembed-0.15.0 lib/oembed/response/photo.rb
ruby-oembed-0.14.1 lib/oembed/response/photo.rb
ruby-oembed-0.14.0 lib/oembed/response/photo.rb
ruby-oembed-0.13.1 lib/oembed/response/photo.rb
ruby-oembed-0.13.0 lib/oembed/response/photo.rb
ruby-oembed-0.12.0 lib/oembed/response/photo.rb
ruby-oembed-0.11.0 lib/oembed/response/photo.rb
ruby-oembed-0.10.1 lib/oembed/response/photo.rb
ruby-oembed-0.10.0 lib/oembed/response/photo.rb
ruby-oembed-0.9.0 lib/oembed/response/photo.rb
ruby-oembed-0.8.14 lib/oembed/response/photo.rb
ruby-oembed-0.8.13 lib/oembed/response/photo.rb
ruby-oembed-0.8.12 lib/oembed/response/photo.rb
ruby-oembed-0.8.11 lib/oembed/response/photo.rb