Class: Ffprober::Parsers::UrlParser
- Inherits:
-
Object
- Object
- Ffprober::Parsers::UrlParser
- Defined in:
- lib/ffprober/parsers/url.rb
Constant Summary collapse
- VALID_URI_REGEX =
/\A#{URI::DEFAULT_PARSER.make_regexp}\z/.freeze
Instance Method Summary collapse
-
#initialize(url_to_parse, exec = Ffprober::Ffmpeg::Exec.new) ⇒ UrlParser
constructor
A new instance of UrlParser.
- #load ⇒ Object
Constructor Details
#initialize(url_to_parse, exec = Ffprober::Ffmpeg::Exec.new) ⇒ UrlParser
Returns a new instance of UrlParser.
11 12 13 14 15 16 |
# File 'lib/ffprober/parsers/url.rb', line 11 def initialize(url_to_parse, exec = Ffprober::Ffmpeg::Exec.new) raise ArgumentError, "#{url_to_parse} is not a valid URL" unless valid_url?(url_to_parse) @url_to_parse = url_to_parse @exec = exec end |
Instance Method Details
#load ⇒ Object
18 19 20 |
# File 'lib/ffprober/parsers/url.rb', line 18 def load JsonParser.new(@exec.json_output(@url_to_parse)) end |