Class: Html2rss::FeedPipeline
- Inherits:
-
Object
- Object
- Html2rss::FeedPipeline
- Defined in:
- lib/html2rss/feed_pipeline.rb,
lib/html2rss/feed_pipeline/auto_fallback.rb
Overview
Coordinates feed generation pipeline stages.
Defined Under Namespace
Classes: AutoFallback
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.
9 10 11 |
# File 'lib/html2rss/feed_pipeline.rb', line 9 def initialize(raw_config) @raw_config = raw_config end |
Instance Method Details
#to_json_feed ⇒ Hash
Returns generated JSONFeed 1.1 payload.
24 25 26 27 28 29 |
# File 'lib/html2rss/feed_pipeline.rb', line 24 def to_json_feed run do |response:, config:, articles:| channel = RssBuilder::Channel.new(response, overrides: config.channel) JsonFeedBuilder.new(channel:, articles:).call end end |
#to_rss ⇒ RSS::Rss
Returns generated RSS feed.
15 16 17 18 19 20 |
# File 'lib/html2rss/feed_pipeline.rb', line 15 def to_rss run do |response:, config:, articles:| channel = RssBuilder::Channel.new(response, overrides: config.channel) RssBuilder.new(channel:, articles:, stylesheets: config.stylesheets).call end end |