Class: WebPageParser::RTPageParserFactory
Constant Summary
collapse
- URL_RE =
ORegexp.new("(www\.)?rt\.com/[^/]+/[0-9]+-.*$")
- INVALID_URL_RE =
ORegexp.new("/(in-vision|in-motion)/")
Class Method Summary
collapse
add_factory, #can_parse?, #create, factories, inherited, load, parser_for
Class Method Details
.can_parse?(options) ⇒ Boolean
5
6
7
8
9
|
# File 'lib/web-page-parser/parsers/rt_page_parser.rb', line 5
def self.can_parse?(options)
url = options[:url].split('#').first
return nil if INVALID_URL_RE.match(url)
URL_RE.match(url)
end
|
.create(options = {}) ⇒ Object
11
12
13
|
# File 'lib/web-page-parser/parsers/rt_page_parser.rb', line 11
def self.create(options = {})
RTPageParserV1.new(options)
end
|