Class: Riiif::AbstractTransformer
- Inherits:
-
Object
- Object
- Riiif::AbstractTransformer
- Defined in:
- app/transformers/riiif/abstract_transformer.rb
Overview
Transforms an image using a backend
Direct Known Subclasses
Instance Attribute Summary collapse
-
#image_info ⇒ Object
readonly
Returns the value of attribute image_info.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#transformation ⇒ Object
readonly
Returns the value of attribute transformation.
Class Method Summary collapse
Instance Method Summary collapse
- #command_builder ⇒ Object
-
#initialize(path, image_info, transformation) ⇒ AbstractTransformer
constructor
A new instance of AbstractTransformer.
- #transform ⇒ Object
Constructor Details
#initialize(path, image_info, transformation) ⇒ AbstractTransformer
Returns a new instance of AbstractTransformer.
11 12 13 14 15 |
# File 'app/transformers/riiif/abstract_transformer.rb', line 11 def initialize(path, image_info, transformation) @path = path @image_info = image_info @transformation = transformation end |
Instance Attribute Details
#image_info ⇒ Object (readonly)
Returns the value of attribute image_info.
17 18 19 |
# File 'app/transformers/riiif/abstract_transformer.rb', line 17 def image_info @image_info end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
17 18 19 |
# File 'app/transformers/riiif/abstract_transformer.rb', line 17 def path @path end |
#transformation ⇒ Object (readonly)
Returns the value of attribute transformation.
17 18 19 |
# File 'app/transformers/riiif/abstract_transformer.rb', line 17 def transformation @transformation end |
Class Method Details
.transform(path, image_info, transformation) ⇒ Object
7 8 9 |
# File 'app/transformers/riiif/abstract_transformer.rb', line 7 def self.transform(path, image_info, transformation) new(path, image_info, transformation).transform end |
Instance Method Details
#command_builder ⇒ Object
23 24 25 |
# File 'app/transformers/riiif/abstract_transformer.rb', line 23 def command_builder @command_builder ||= command_factory.new(path, image_info, transformation) end |
#transform ⇒ Object
19 20 21 |
# File 'app/transformers/riiif/abstract_transformer.rb', line 19 def transform execute(command_builder.command) end |