Class: Html2rss::AutoSource::Scraper::WordpressApi::PageScope::Resolver
- Inherits:
-
Object
- Object
- Html2rss::AutoSource::Scraper::WordpressApi::PageScope::Resolver
- Defined in:
- lib/html2rss/auto_source/scraper/wordpress_api/page_scope.rb
Overview
Resolves the page scope from page markup and canonical URL signals.
Instance Method Summary collapse
-
#call ⇒ PageScope
Derived page scope.
-
#initialize(parsed_body:, url:) ⇒ Resolver
constructor
A new instance of Resolver.
Constructor Details
#initialize(parsed_body:, url:) ⇒ Resolver
Returns a new instance of Resolver.
53 54 55 56 |
# File 'lib/html2rss/auto_source/scraper/wordpress_api/page_scope.rb', line 53 def initialize(parsed_body:, url:) @parsed_body = parsed_body @url = Html2rss::Url.from_absolute(url) end |
Instance Method Details
#call ⇒ PageScope
Returns derived page scope.
60 61 62 63 64 65 66 |
# File 'lib/html2rss/auto_source/scraper/wordpress_api/page_scope.rb', line 60 def call category_scope || tag_scope || || date_scope || fallback_scope end |