Class: Html2rss::LinkDestination::DestinationFacts
- Inherits:
-
Data
- Object
- Data
- Html2rss::LinkDestination::DestinationFacts
- Defined in:
- lib/html2rss/link_destination/destination_facts.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
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def content_path @content_path end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def destination @destination end |
#high_confidence_junk_path ⇒ Object (readonly)
Returns the value of attribute high_confidence_junk_path
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 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
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def high_confidence_utility_destination @high_confidence_utility_destination end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def segments @segments end |
#shallow ⇒ Object (readonly)
Returns the value of attribute shallow
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def shallow @shallow end |
#strong_post_suffix ⇒ Object (readonly)
Returns the value of attribute strong_post_suffix
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def strong_post_suffix @strong_post_suffix end |
#taxonomy_path ⇒ Object (readonly)
Returns the value of attribute taxonomy_path
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def taxonomy_path @taxonomy_path end |
#url ⇒ Object (readonly)
Returns the value of attribute url
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def url @url end |
#utility_path ⇒ Object (readonly)
Returns the value of attribute utility_path
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def utility_path @utility_path end |
#vanity_path ⇒ Object (readonly)
Returns the value of attribute vanity_path
6 7 8 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 6 def vanity_path @vanity_path end |
Class Method Details
.build(url) ⇒ DestinationFacts
Returns route facts for downstream link scoring.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/html2rss/link_destination/destination_facts.rb', line 21 def self.build(url) # rubocop:disable Metrics/MethodLength classifier = PathClassifier.new(url.path_segments) new( url:, destination: url.to_s, segments: classifier.segments, strong_post_suffix: classifier.strong_post_suffix?, content_path: classifier.content_path?, utility_path: classifier.utility_path?, taxonomy_path: classifier.taxonomy_path?, vanity_path: classifier.vanity_path?, shallow: classifier.shallow?, high_confidence_junk_path: classifier.junk_path?, high_confidence_utility_destination: classifier.utility_destination? ) end |