class Ffprober::Parser

Public Class Methods

check_version() click to toggle source
# 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) click to toggle source
# 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
from_json(json_to_parse) click to toggle source
# File lib/ffprober/parser.rb, line 29
def self.from_json(json_to_parse)
  json_parser = Parsers::JsonParser.new(json_to_parse)
  Ffprober::Wrapper.new(json_parser.json)
end
from_url(url_to_parse) click to toggle source
# File lib/ffprober/parser.rb, line 20
def self.from_url(url_to_parse)
  check_version

  url_parser = Parsers::UrlParser.new(url_to_parse)
  json_parser = url_parser.load
  Ffprober::Wrapper.new(json_parser.json)
end