Class: Ffprober::Parsers::FileParser

Inherits:
Object
  • Object
show all
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.



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

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

  @file_to_parse = file_to_parse
  @exec = exec
end

Instance Method Details

#loadObject



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

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