Class: SimpleImagesDownloader::Strategies::FromFileStrategy
- Defined in:
- lib/simple_images_downloader/strategies/from_file_strategy.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ FromFileStrategy
constructor
A new instance of FromFileStrategy.
- #process ⇒ Object
Constructor Details
#initialize(path) ⇒ FromFileStrategy
Returns a new instance of FromFileStrategy.
6 7 8 9 |
# File 'lib/simple_images_downloader/strategies/from_file_strategy.rb', line 6 def initialize(path) super @path = path end |
Instance Method Details
#process ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/simple_images_downloader/strategies/from_file_strategy.rb', line 11 def process source_file = SourceFile.new(@path) source_file.each_line do |line| uri = Line.new(line).uri Downloader.new(uri).download rescue Errors::BaseError => e puts e. next end end |