Class: Html2rss::AutoSource::Scraper::LinkHeuristics::DestinationFacts
- Inherits:
-
Data
- Object
- Data
- Html2rss::AutoSource::Scraper::LinkHeuristics::DestinationFacts
- Defined in:
- lib/html2rss/auto_source/scraper/link_heuristics.rb
Overview
Normalized URL plus reusable route-classification facts for one link.
Instance Attribute Summary collapse
-
#content_path ⇒ Object
readonly
Returns the value of attribute content_path.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#high_confidence_junk_path ⇒ Object
readonly
Returns the value of attribute high_confidence_junk_path.
-
#high_confidence_utility_destination ⇒ Object
readonly
Returns the value of attribute high_confidence_utility_destination.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
-
#shallow ⇒ Object
readonly
Returns the value of attribute shallow.
-
#strong_post_suffix ⇒ Object
readonly
Returns the value of attribute strong_post_suffix.
-
#taxonomy_path ⇒ Object
readonly
Returns the value of attribute taxonomy_path.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#utility_path ⇒ Object
readonly
Returns the value of attribute utility_path.
-
#vanity_path ⇒ Object
readonly
Returns the value of attribute vanity_path.
Class Method Summary collapse
-
.build(url) ⇒ DestinationFacts
Route facts for downstream link scoring.
Instance Attribute Details
#content_path ⇒ Object (readonly)
Returns the value of attribute content_path
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def content_path @content_path end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def destination @destination end |
#high_confidence_junk_path ⇒ Object (readonly)
Returns the value of attribute high_confidence_junk_path
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def high_confidence_junk_path @high_confidence_junk_path end |
#high_confidence_utility_destination ⇒ Object (readonly)
Returns the value of attribute high_confidence_utility_destination
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def high_confidence_utility_destination @high_confidence_utility_destination end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def segments @segments end |
#shallow ⇒ Object (readonly)
Returns the value of attribute shallow
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def shallow @shallow end |
#strong_post_suffix ⇒ Object (readonly)
Returns the value of attribute strong_post_suffix
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def strong_post_suffix @strong_post_suffix end |
#taxonomy_path ⇒ Object (readonly)
Returns the value of attribute taxonomy_path
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def taxonomy_path @taxonomy_path end |
#url ⇒ Object (readonly)
Returns the value of attribute url
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def url @url end |
#utility_path ⇒ Object (readonly)
Returns the value of attribute utility_path
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def utility_path @utility_path end |
#vanity_path ⇒ Object (readonly)
Returns the value of attribute vanity_path
12 13 14 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 12 def vanity_path @vanity_path end |
Class Method Details
.build(url) ⇒ DestinationFacts
Returns route facts for downstream link scoring.
27 28 29 30 31 32 33 34 35 |
# File 'lib/html2rss/auto_source/scraper/link_heuristics.rb', line 27 def self.build(url) classifier = PathClassifier.new(url.path_segments) new( url:, destination: url.to_s, **classifier.destination_attributes ) end |