Class: Html2rss::ScrapeTarget
- Inherits:
-
Data
- Object
- Data
- Html2rss::ScrapeTarget
- Defined in:
- lib/html2rss/scrape_target.rb
Overview
Immutable entry vs effective scrape URLs for one pipeline run.
Replaces mutating Config#scrape_url= after FeedResolution rewrites the fetch URL.
Instance Attribute Summary collapse
-
#effective_url ⇒ Object
readonly
Returns the value of attribute effective_url.
-
#entry_url ⇒ Object
readonly
Returns the value of attribute entry_url.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#effective_url ⇒ Object (readonly)
Returns the value of attribute effective_url
8 9 10 |
# File 'lib/html2rss/scrape_target.rb', line 8 def effective_url @effective_url end |
#entry_url ⇒ Object (readonly)
Returns the value of attribute entry_url
8 9 10 |
# File 'lib/html2rss/scrape_target.rb', line 8 def entry_url @entry_url end |
Class Method Details
.from_config(config) ⇒ ScrapeTarget
12 13 14 15 |
# File 'lib/html2rss/scrape_target.rb', line 12 def self.from_config(config) entry = config.url new(entry_url: entry, effective_url: entry) end |
Instance Method Details
#with_effective(url) ⇒ ScrapeTarget
20 21 22 |
# File 'lib/html2rss/scrape_target.rb', line 20 def with_effective(url) self.class.new(entry_url:, effective_url: Url.from_absolute(url).to_s) end |