Class: RubyTapasDownloader::Extractors::Episode
- Inherits:
-
RubyTapasDownloader::Extractor
- Object
- RubyTapasDownloader::Extractor
- RubyTapasDownloader::Extractors::Episode
- Defined in:
- lib/ruby_tapas_downloader/extractors/episode.rb
Overview
Extract an Episode from an Feed Item.
Instance Method Summary collapse
-
#extract(item) ⇒ RubyTapasDownloader::Downloadables::Episode
The Episode extracted from feed item.
-
#initialize(files_extractor = RubyTapasDownloader::Extractors::Files.new) ⇒ Episode
constructor
A new instance of Episode.
Constructor Details
#initialize(files_extractor = RubyTapasDownloader::Extractors::Files.new) ⇒ Episode
Returns a new instance of Episode.
5 6 7 |
# File 'lib/ruby_tapas_downloader/extractors/episode.rb', line 5 def initialize(files_extractor = RubyTapasDownloader::Extractors::Files.new) @files_extractor = files_extractor end |
Instance Method Details
#extract(item) ⇒ RubyTapasDownloader::Downloadables::Episode
Returns the Episode extracted from feed item.
13 14 15 16 17 18 19 |
# File 'lib/ruby_tapas_downloader/extractors/episode.rb', line 13 def extract(item) title = CGI.unescapeHTML item.title link = item.link files = @files_extractor.extract item.description RubyTapasDownloader::Downloadables::Episode.new title, link, files end |