Class: RubyTapasDownloader::Extractors::Files
- Inherits:
-
RubyTapasDownloader::Extractor
- Object
- RubyTapasDownloader::Extractor
- RubyTapasDownloader::Extractors::Files
- Defined in:
- lib/ruby_tapas_downloader/extractors/files.rb
Overview
Extract a Set of Files from an Feed Item Description.
Instance Method Summary collapse
-
#extract(item_description) ⇒ Set<RubyTapasDownloader::Downloadables::File>
The Set of Files extracted from feed item description.
Instance Method Details
#extract(item_description) ⇒ Set<RubyTapasDownloader::Downloadables::File>
Returns the Set of Files extracted from feed item description.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ruby_tapas_downloader/extractors/files.rb', line 7 def extract(item_description) files = Set.new document = REXML::Document.new item_description document.elements.each("/div[@class='blog-entry']/ul/li/a") do |element| name = element.text link = element.attribute('href').to_s files << RubyTapasDownloader::Downloadables::File.new(name, link) end files end |