Class: RMD::Processor
- Inherits:
-
Object
- Object
- RMD::Processor
- Defined in:
- lib/rmd/processor.rb
Instance Attribute Summary collapse
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(link, options = {}) ⇒ Processor
constructor
A new instance of Processor.
- #process ⇒ Object
Constructor Details
#initialize(link, options = {}) ⇒ Processor
Returns a new instance of Processor.
9 10 11 12 |
# File 'lib/rmd/processor.rb', line 9 def initialize(link, = {}) @link = link @options = end |
Instance Attribute Details
#link ⇒ Object (readonly)
Returns the value of attribute link.
7 8 9 |
# File 'lib/rmd/processor.rb', line 7 def link @link end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/rmd/processor.rb', line 7 def @options end |
Class Method Details
.process(link, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/rmd/processor.rb', line 28 def self.process(link, = {}) begin new(link, ).process rescue => error puts error..red puts 'Errors! Can not continue!'.red end end |
Instance Method Details
#process ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rmd/processor.rb', line 14 def process puts "Start processing #{link}...".green playlist = RMD::Factory::Main.build(link) playlist.fetch if playlist.success? strategy.process(playlist.songs) end playlist.errors.each do |error| puts error.red end end |