Class: ImageInfo::Processor
- Inherits:
-
Object
- Object
- ImageInfo::Processor
- Defined in:
- lib/image_info/processor.rb
Instance Attribute Summary collapse
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(urls, options = {}) ⇒ Processor
constructor
A new instance of Processor.
- #process ⇒ Object
Constructor Details
#initialize(urls, options = {}) ⇒ Processor
Returns a new instance of Processor.
12 13 14 15 |
# File 'lib/image_info/processor.rb', line 12 def initialize(urls, = {}) @images = Array(urls).map { |uri| ::ImageInfo::Image.new(uri) }.keep_if(&:valid?) = end |
Instance Attribute Details
#images ⇒ Object (readonly)
Returns the value of attribute images.
10 11 12 |
# File 'lib/image_info/processor.rb', line 10 def images @images end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/image_info/processor.rb', line 10 def end |
Instance Method Details
#process ⇒ Object
17 18 19 20 21 22 |
# File 'lib/image_info/processor.rb', line 17 def process images.each { |image| hydra.queue(::ImageInfo::RequestHandler.new(image).build) } hydra.run images end |