Sha256: 03e2bc3aa372327623c21c30a35e989e65a74495dee4ddd7719a39e688b56519

Contents?: true

Size: 265 Bytes

Versions: 11

Compression:

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

11 entries across 11 versions & 1 rubygems

Version Path
onebox-1.3.0 lib/onebox/engine/image_onebox.rb
onebox-1.2.9 lib/onebox/engine/image_onebox.rb
onebox-1.2.8 lib/onebox/engine/image_onebox.rb
onebox-1.2.7 lib/onebox/engine/image_onebox.rb
onebox-1.2.6 lib/onebox/engine/image_onebox.rb
onebox-1.2.5 lib/onebox/engine/image_onebox.rb
onebox-1.2.4 lib/onebox/engine/image_onebox.rb
onebox-1.2.3 lib/onebox/engine/image_onebox.rb
onebox-1.2.2 lib/onebox/engine/image_onebox.rb
onebox-1.2.1 lib/onebox/engine/image_onebox.rb
onebox-1.2.0 lib/onebox/engine/image_onebox.rb