Class: SimpleImagesDownloader::Validatable::DestinationValidator
- Inherits:
-
Validator
- Object
- Validator
- SimpleImagesDownloader::Validatable::DestinationValidator
- Defined in:
- lib/simple_images_downloader/validatable/destination_validator.rb
Overview
DestinationValidator class Responsible for validating destination path
Instance Method Summary collapse
Instance Method Details
#validate(options) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/simple_images_downloader/validatable/destination_validator.rb', line 15 def validate() path = [:path] raise Errors::DestinationIsNotDirectory, path unless File.directory?(path) raise Errors::DestinationIsNotWritable, path unless File.writable?(path) end |