Class: RubyTapasDownloader::Extractors::Catalog
- Inherits:
-
RubyTapasDownloader::Extractor
- Object
- RubyTapasDownloader::Extractor
- RubyTapasDownloader::Extractors::Catalog
- Defined in:
- lib/ruby_tapas_downloader/extractors/catalog.rb
Overview
Extract an Catalog from an Feed.
Instance Method Summary collapse
-
#extract(feed) ⇒ RubyTapasDownloader::Downloadables::Catalog
The Catalog extracted from feed.
-
#initialize(episode_extractor = RubyTapasDownloader::Extractors::Episode.new) ⇒ Catalog
constructor
A new instance of Catalog.
Constructor Details
#initialize(episode_extractor = RubyTapasDownloader::Extractors::Episode.new) ⇒ Catalog
Returns a new instance of Catalog.
5 6 7 8 |
# File 'lib/ruby_tapas_downloader/extractors/catalog.rb', line 5 def initialize(episode_extractor = RubyTapasDownloader::Extractors::Episode.new) @episode_extractor = episode_extractor end |
Instance Method Details
#extract(feed) ⇒ RubyTapasDownloader::Downloadables::Catalog
Returns the Catalog extracted from feed.
13 14 15 16 17 18 19 20 21 |
# File 'lib/ruby_tapas_downloader/extractors/catalog.rb', line 13 def extract(feed) episodes = Set.new feed.items.each do |item| episodes << @episode_extractor.extract(item) end RubyTapasDownloader::Downloadables::Catalog.new episodes end |