Class: Html2rss::FeedPipeline
- Inherits:
-
Object
- Object
- Html2rss::FeedPipeline
- Defined in:
- lib/html2rss/feed_pipeline.rb,
lib/html2rss/feed_pipeline/auto_fallback.rb,
lib/html2rss/feed_pipeline/strategy_plan.rb,
lib/html2rss/feed_pipeline/runtime_policy.rb
Overview
Builds feeds from validated config through request, extraction, and rendering stages.
Defined Under Namespace
Classes: AutoFallback, ExtractionContext, RuntimePolicy, StrategyPlan
Instance Method Summary collapse
-
#initialize(raw_config) ⇒ FeedPipeline
constructor
A new instance of FeedPipeline.
-
#to_json_feed ⇒ Hash
Generated JSONFeed 1.1 payload.
-
#to_rss ⇒ RSS::Rss
Generated RSS feed.
Constructor Details
#initialize(raw_config) ⇒ FeedPipeline
Returns a new instance of FeedPipeline.
12 13 14 |
# File 'lib/html2rss/feed_pipeline.rb', line 12 def initialize(raw_config) @raw_config = raw_config end |
Instance Method Details
#to_json_feed ⇒ Hash
Returns generated JSONFeed 1.1 payload.
27 28 29 30 31 32 |
# File 'lib/html2rss/feed_pipeline.rb', line 27 def to_json_feed run do |response:, config:, articles:| channel = Html2rss::Channel.new(response, overrides: config.channel) FeedBuilder.build(:json_feed, channel:, articles:) end end |
#to_rss ⇒ RSS::Rss
Returns generated RSS feed.
18 19 20 21 22 23 |
# File 'lib/html2rss/feed_pipeline.rb', line 18 def to_rss run do |response:, config:, articles:| channel = Html2rss::Channel.new(response, overrides: config.channel) FeedBuilder.build(:rss, channel:, articles:, stylesheets: config.stylesheets) end end |