Class: Ffprober::Parsers::FileParser
- Inherits:
-
Object
- Object
- Ffprober::Parsers::FileParser
- Extended by:
- T::Sig
- 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.
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
#load ⇒ Object
23 24 25 |
# File 'lib/ffprober/parsers/file.rb', line 23 def load JsonParser.new(@exec.json_output(@file_to_parse)) end |