Class: SimpleImagesDownloader::Validatable::FilePersistanceValidator

Inherits:
Validator
  • Object
show all
Defined in:
lib/simple_images_downloader/validatable/file_persistance_validator.rb

Overview

FilePersistanceValidator class Responsible for validating file persistance

Examples:

SimpleImagesDownloader::FilePersistanceValidator.new.validate({ path: './urls.txt' })

Instance Method Summary collapse

Instance Method Details

#validate(options) ⇒ Object

Parameters:

  • options (Hash)

    hash with path to file

Raises:



14
15
16
17
18
# File 'lib/simple_images_downloader/validatable/file_persistance_validator.rb', line 14

def validate(options)
  return if File.exist?(options[:path])

  raise Errors::MissingFileError, options[:path]
end