Class: Genit::RssFeedItems

Inherits:
Object
  • Object
show all
Defined in:
lib/genit/project/rss_feed.rb

Overview

Items of an RSS Field

Instance Method Summary collapse

Constructor Details

#initialize(feed, news_files, config) ⇒ RssFeedItems

Returns a new instance of RssFeedItems.



51
52
53
54
55
# File 'lib/genit/project/rss_feed.rb', line 51

def initialize feed, news_files, config
  @feed = feed
  @news_files = news_files
  @config = config
end

Instance Method Details

#fillObject



57
58
59
60
61
62
63
64
# File 'lib/genit/project/rss_feed.rb', line 57

def fill
  @news_files.each do |news|
    item = @feed.items.new_item
    item.title = RssFeedItemTitle.new(news).title
    item.link = @config[:address]
    item.date = Time.parse(NewsUtils.get_date_from_filename(news))
  end
end