Class: Rails::WebP::PostProcessor
- Inherits:
-
Object
- Object
- Rails::WebP::PostProcessor
- Defined in:
- lib/rails/webp/post_processor.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename, &block) ⇒ PostProcessor
constructor
A new instance of PostProcessor.
- #render(context, empty_hash_wtf) ⇒ Object
Constructor Details
#initialize(filename, &block) ⇒ PostProcessor
Returns a new instance of PostProcessor.
4 5 6 7 |
# File 'lib/rails/webp/post_processor.rb', line 4 def initialize(filename, &block) @filename = filename @source = block.call end |
Class Method Details
.call(input) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rails/webp/post_processor.rb', line 17 def self.call(input) filename = input[:filename] source = input[:data] context = input[:environment].context_class.new(input) result = run(filename, source, context) context..merge(data: result) end |
Instance Method Details
#render(context, empty_hash_wtf) ⇒ Object
9 10 11 |
# File 'lib/rails/webp/post_processor.rb', line 9 def render(context, empty_hash_wtf) self.class.run(@filename, @source, context) end |