class Rails::WebP::PostProcessor

Public Class Methods

call(input) click to toggle source
# 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.metadata.merge(data: result)
end
new(filename, &block) click to toggle source
# File lib/rails/webp/post_processor.rb, line 4
def initialize(filename, &block)
  @filename = filename
  @source   = block.call
end
run(filename, data, context) click to toggle source
# File lib/rails/webp/post_processor.rb, line 13
def self.run(filename, data, context)
  Converter.process(filename, data, context)
end

Public Instance Methods

render(context, empty_hash_wtf) click to toggle source
# File lib/rails/webp/post_processor.rb, line 9
def render(context, empty_hash_wtf)
  self.class.run(@filename, @source, context)
end