Class: RubyTapasDownloader::Downloadables::Catalog
- Inherits:
-
RubyTapasDownloader::Downloadable
- Object
- RubyTapasDownloader::Downloadable
- RubyTapasDownloader::Downloadables::Catalog
- Defined in:
- lib/ruby_tapas_downloader/downloadables/catalog.rb
Overview
Catalog is the set of all Ruby Tapas Episodes.
Instance Attribute Summary collapse
-
#episodes ⇒ Set<RubyTapasDownloader::Downloadables::Episode>
readonly
The Episodes.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#download(basepath, agent) ⇒ Object
Download the Catalog.
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(episodes) ⇒ Catalog
constructor
A new instance of Catalog.
Constructor Details
#initialize(episodes) ⇒ Catalog
Returns a new instance of Catalog.
8 9 10 |
# File 'lib/ruby_tapas_downloader/downloadables/catalog.rb', line 8 def initialize(episodes) @episodes = episodes end |
Instance Attribute Details
#episodes ⇒ Set<RubyTapasDownloader::Downloadables::Episode> (readonly)
Returns the Episodes.
6 7 8 |
# File 'lib/ruby_tapas_downloader/downloadables/catalog.rb', line 6 def episodes @episodes end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 |
# File 'lib/ruby_tapas_downloader/downloadables/catalog.rb', line 23 def ==(other) episodes == other.episodes end |
#download(basepath, agent) ⇒ Object
Download the Catalog.
16 17 18 19 20 21 |
# File 'lib/ruby_tapas_downloader/downloadables/catalog.rb', line 16 def download(basepath, agent) RubyTapasDownloader.logger.info 'Starting download of catalog in ' \ "`#{ basepath }'..." FileUtils.mkdir_p basepath episodes.each { |episode| episode.download basepath, agent } end |
#eql?(other) ⇒ Boolean
27 28 29 |
# File 'lib/ruby_tapas_downloader/downloadables/catalog.rb', line 27 def eql?(other) episodes.eql? other.episodes end |
#hash ⇒ Object
31 32 33 |
# File 'lib/ruby_tapas_downloader/downloadables/catalog.rb', line 31 def hash episodes.hash end |