class SimpleImagesDownloader::ImagePathValidator

Constants

VALID_EXTENSIONS

Public Class Methods

new(path) click to toggle source
# File lib/simple_images_downloader/image_path_validator.rb, line 7
def initialize(path)
  @path = path
end

Public Instance Methods

validate() click to toggle source
# File lib/simple_images_downloader/image_path_validator.rb, line 11
def validate
  raise Errors::MissingImageInPath, @path unless VALID_EXTENSIONS.include?(extension)
end

Private Instance Methods

extension() click to toggle source
# File lib/simple_images_downloader/image_path_validator.rb, line 17
def extension
  File.extname(@path)
end