Class: Rszr::BatchTransformation
- Inherits:
-
Object
- Object
- Rszr::BatchTransformation
- Defined in:
- lib/rszr/batch_transformation.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#transformations ⇒ Object
readonly
Returns the value of attribute transformations.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(path, **opts) ⇒ BatchTransformation
constructor
A new instance of BatchTransformation.
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
#image ⇒ Object (readonly)
Returns the value of attribute image.
3 4 5 |
# File 'lib/rszr/batch_transformation.rb', line 3 def image @image end |
#transformations ⇒ Object (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
#call ⇒ Object
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 |