Class: Plumnailer::ImgUrlFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/plumnailer/img_url_filter.rb

Overview

Decide whether to process images based on their url.

Constant Summary collapse

ImgUrlPatterns =
[
%r{^http://ad\.doubleclick\.net/},
%r{^http://b\.scorecardresearch\.com/},
%r{^http://pixel\.quantserve\.com/},
%r{^http://s7\.addthis\.com/},
]

Instance Method Summary collapse

Instance Method Details

#reject?(img_url) ⇒ Boolean

Return true if this image url should not be considered.

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/plumnailer/img_url_filter.rb', line 7

def reject?(img_url)
  ImgUrlPatterns.each do |re|
    return true  if img_url and img_url.to_s[re]
  end
  false
end