Class: Ffprober::Parsers::File
- Inherits:
-
Object
- Object
- Ffprober::Parsers::File
- Defined in:
- lib/ffprober/parsers/file.rb
Instance Method Summary collapse
-
#initialize(file_to_parse) ⇒ File
constructor
A new instance of File.
- #load ⇒ Object
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
#load ⇒ Object
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 |