Class: Html2rss::ScrapeTarget

Inherits:
Data
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#effective_urlObject (readonly)

Returns the value of attribute effective_url

Returns:

  • (Object)

    the current value of effective_url



8
9
10
# File 'lib/html2rss/scrape_target.rb', line 8

def effective_url
  @effective_url
end

#entry_urlObject (readonly)

Returns the value of attribute entry_url

Returns:

  • (Object)

    the current value of 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

Parameters:

Returns:



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

Parameters:

Returns:



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