Class: Perron::Site::Builder::Feeds::Rss
- Inherits:
-
Object
- Object
- Perron::Site::Builder::Feeds::Rss
- Defined in:
- lib/perron/site/builder/feeds/rss.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(collection:) ⇒ Rss
constructor
A new instance of Rss.
Methods included from Template
#current_feed_url, #feed_configuration, #find_template, #render, #routes, #url_for_resource
Constructor Details
#initialize(collection:) ⇒ Rss
Returns a new instance of Rss.
14 15 16 17 |
# File 'lib/perron/site/builder/feeds/rss.rb', line 14 def initialize(collection:) @collection = collection @configuration = Perron.configuration end |
Instance Method Details
#generate ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/perron/site/builder/feeds/rss.rb', line 19 def generate return if resources.empty? template = find_template("rss") return unless template render(template, feed_configuration) end |