Class: Ffprober::Parsers::File

Inherits:
Object
  • Object
show all
Defined in:
lib/ffprober/parsers/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(file_to_parse) ⇒ File

Returns a new instance of File.



4
5
6
7
8
9
10
# File 'lib/ffprober/parsers/file.rb', line 4

def initialize(file_to_parse)
  unless ::File.exist?(file_to_parse)
    fail ArgumentError.new("File not found #{file_to_parse}")
  end

  @file_to_parse = file_to_parse
end

Instance Method Details

#loadObject



12
13
14
15
# File 'lib/ffprober/parsers/file.rb', line 12

def load
  json_output = `#{ffprobe_finder.path} #{options} '#{@file_to_parse}'`
  Ffprober::Parsers::Json.new(json_output)
end