Class: Imgfetcha::FileReader

Inherits:
Object
  • Object
show all
Defined in:
lib/imgfetcha/file_reader.rb,
lib/imgfetcha/errors/no_urls_found_error.rb,
lib/imgfetcha/errors/input_file_not_specified_error.rb

Defined Under Namespace

Classes: InputFileNotSpecifiedError, NoUrlsFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FileReader

Returns a new instance of FileReader.



5
6
7
8
# File 'lib/imgfetcha/file_reader.rb', line 5

def initialize(options)
  @input_file = options[:input_file]
  @verbose    = options[:verbose]
end

Instance Attribute Details

#input_fileObject (readonly)

Returns the value of attribute input_file.



3
4
5
# File 'lib/imgfetcha/file_reader.rb', line 3

def input_file
  @input_file
end

#resultObject (readonly)

Returns the value of attribute result.



3
4
5
# File 'lib/imgfetcha/file_reader.rb', line 3

def result
  @result
end

Instance Method Details

#runObject



10
11
12
13
14
15
# File 'lib/imgfetcha/file_reader.rb', line 10

def run
  read_file
  filter_urls
  report_results if @verbose
  @result
end