Class: Ffprober::Parsers::FileParser
- Inherits:
-
Object
- Object
- Ffprober::Parsers::FileParser
- Defined in:
- lib/ffprober/parsers/file.rb
Instance Method Summary collapse
-
#initialize(file_to_parse, exec = Ffprober::Ffmpeg::Exec.new) ⇒ FileParser
constructor
A new instance of FileParser.
- #load ⇒ Object
Constructor Details
#initialize(file_to_parse, exec = Ffprober::Ffmpeg::Exec.new) ⇒ FileParser
Returns a new instance of FileParser.
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 |
Instance Method Details
#load ⇒ Object
14 15 16 |
# File 'lib/ffprober/parsers/file.rb', line 14 def load JsonParser.new(@exec.json_output(@file_to_parse)) end |