Class: Ffprober::Parsers::FileParser

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/ffprober/parsers/file.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of FileParser.

Raises:

  • (ArgumentError)


15
16
17
18
19
20
# File 'lib/ffprober/parsers/file.rb', line 15

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

Instance Method Details

#loadObject



23
24
25
# File 'lib/ffprober/parsers/file.rb', line 23

def load
  JsonParser.new(@exec.json_output(@file_to_parse))
end