Sha256: 497b222a85557500d6f5268c4ee0ad3bfb99be4c352eb113da8a0f2194a59f14

Contents?: true

Size: 272 Bytes

Versions: 8

Compression:

Stored size: 272 Bytes

Contents

module Onebox
  module Engine
    class ImageOnebox
      include Engine

      matches_regexp /^(https?:)?\/\/.+\.(png|jpg|jpeg|gif|bmp|tif|tiff)(\?.*)?$/i

      def to_html
        "<a href='#{@url}' target='_blank'><img src='#{@url}'></a>"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
onebox-1.3.8 lib/onebox/engine/image_onebox.rb
onebox-1.3.7 lib/onebox/engine/image_onebox.rb
onebox-1.3.6 lib/onebox/engine/image_onebox.rb
onebox-1.3.5 lib/onebox/engine/image_onebox.rb
onebox-1.3.4 lib/onebox/engine/image_onebox.rb
onebox-1.3.3 lib/onebox/engine/image_onebox.rb
onebox-1.3.2 lib/onebox/engine/image_onebox.rb
onebox-1.3.1 lib/onebox/engine/image_onebox.rb