Class: Ffprober::Parser
- Inherits:
-
Object
- Object
- Ffprober::Parser
- Extended by:
- T::Sig
- Defined in:
- lib/ffprober/parser.rb
Class Method Summary collapse
- .check_version ⇒ Object
- .from_file(file_to_parse) ⇒ Object
- .from_json(json_to_parse) ⇒ Object
- .from_url(url_to_parse) ⇒ Object
Class Method Details
.check_version ⇒ Object
35 36 37 38 |
# File 'lib/ffprober/parser.rb', line 35 def self.check_version msg = "found version: #{FfprobeVersion.version}" raise UnsupportedVersion, msg if FfprobeVersion.invalid? end |
.from_file(file_to_parse) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/ffprober/parser.rb', line 9 def self.from_file(file_to_parse) check_version raise EmptyInput, file_to_parse if File.zero?(file_to_parse) file_parser = Parsers::FileParser.new(file_to_parse) json_parser = file_parser.load Ffprober::Wrapper.new(json_parser.json) end |