Sha256: 3964519f2ccbadd649ed7e18363b789512b4905b92d48c73a20fade307fc3dc2

Contents?: true

Size: 463 Bytes

Versions: 30

Compression:

Stored size: 463 Bytes

Contents

require 'delegate'

module LinkThumbnailer
  class ImageValidator < ::SimpleDelegator

    attr_reader :config, :image

    def initialize(image)
      @config = ::LinkThumbnailer.page.config
      @image  = image

      super(config)
    end

    def call
      blacklist_urls.each do |url|
        return false if image.src && image.src.to_s[url]
      end

      true
    end

    private

    def blacklist_urls
      config.blacklist_urls
    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
link_thumbnailer-3.3.1 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.3.0 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.2.1 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.2.0 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.1.2 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.1.1 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.1.0 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.0.3 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.0.2 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.0.1 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-3.0.0 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.6.1 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.6.0 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.5.2 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.5.1 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.5.0 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.4.0 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.3.2 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.3.1 lib/link_thumbnailer/image_validator.rb
link_thumbnailer-2.3.0 lib/link_thumbnailer/image_validator.rb