Class: LinkThumbnailer::ImageValidator
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- LinkThumbnailer::ImageValidator
- Defined in:
- lib/link_thumbnailer/image_validator.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(image) ⇒ ImageValidator
constructor
A new instance of ImageValidator.
Constructor Details
#initialize(image) ⇒ ImageValidator
Returns a new instance of ImageValidator.
8 9 10 11 12 13 |
# File 'lib/link_thumbnailer/image_validator.rb', line 8 def initialize(image) @config = ::LinkThumbnailer.page.config @image = image super(config) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/link_thumbnailer/image_validator.rb', line 6 def config @config end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
6 7 8 |
# File 'lib/link_thumbnailer/image_validator.rb', line 6 def image @image end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/link_thumbnailer/image_validator.rb', line 15 def call blacklist_urls.each do |url| return false if image.src && image.src.to_s[url] end true end |