Method: Ffprober::Parsers::FileParser#initialize

Defined in:
lib/ffprober/parsers/file.rb

#initialize(file_to_parse, exec = Ffprober::Ffmpeg::Exec.new) ⇒ FileParser

Returns a new instance of FileParser.

Raises:

  • (ArgumentError)


7
8
9
10
11
12
# File 'lib/ffprober/parsers/file.rb', line 7

def initialize(file_to_parse, exec = Ffprober::Ffmpeg::Exec.new)
  raise ArgumentError, "File not found #{file_to_parse}" unless ::File.exist?(file_to_parse)

  @file_to_parse = file_to_parse
  @exec = exec
end