Class: ImageProcessing::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/image_processing/processor.rb

Direct Known Subclasses

MiniMagick::Processor, Vips::Processor

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ Processor

Returns a new instance of Processor.



3
4
5
# File 'lib/image_processing/processor.rb', line 3

def initialize(pipeline)
  @pipeline = pipeline
end

Instance Method Details

#apply_operation(name, image, *args) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/image_processing/processor.rb', line 7

def apply_operation(name, image, *args)
  if respond_to?(name)
    public_send(name, image, *args)
  else
    image.send(name, *args)
  end
end

#custom(image, block) ⇒ Object



15
16
17
# File 'lib/image_processing/processor.rb', line 15

def custom(image, block)
  (block && block.call(image)) || image
end