Class: Rszr::BatchTransformation

Inherits:
Object
  • Object
show all
Defined in:
lib/rszr/batch_transformation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, **opts) ⇒ BatchTransformation

Returns a new instance of BatchTransformation.



5
6
7
8
9
# File 'lib/rszr/batch_transformation.rb', line 5

def initialize(path, **opts)
  puts "INITIALIZED BATCH for #{path}"
  @image = path.is_a?(Image) ? path : Image.load(path, **opts)
  @transformations = []
end

Instance Attribute Details

#imageObject (readonly)

Returns the value of attribute image.



3
4
5
# File 'lib/rszr/batch_transformation.rb', line 3

def image
  @image
end

#transformationsObject (readonly)

Returns the value of attribute transformations.



3
4
5
# File 'lib/rszr/batch_transformation.rb', line 3

def transformations
  @transformations
end

Instance Method Details

#callObject



18
19
20
21
# File 'lib/rszr/batch_transformation.rb', line 18

def call
  transformations.each { |method, args| image.public_send("#{method}!", *args) }
  image
end