Module: Knuckles::Stages::Enhancer
Overview
The enhancer modifies rendered data using proc passed through options. The enhancer stage is critical to customizing the final output. For example, if staff should have confidential data that regular users can’t see you can enhance the final values. Another use of enhancers is personalizing an otherwise generic response.
Instance Method Summary collapse
-
#call(prepared, options) ⇒ Object
Modify all results using an ‘enhancer` proc.
Instance Method Details
#call(prepared, options) ⇒ Object
Modify all results using an ‘enhancer` proc.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/knuckles/stages/enhancer.rb', line 37 def call(prepared, ) enhancer = [:enhancer] if enhancer prepared.each do |hash| hash[:result] = enhancer.call(hash[:result], ) end end prepared end |