Class: Manacle::Proxy::Method::Constrained::Postprocessor
- Inherits:
-
Object
- Object
- Manacle::Proxy::Method::Constrained::Postprocessor
- Defined in:
- lib/manacle/proxy/method/constrained.rb
Instance Method Summary collapse
-
#initialize(proxy) ⇒ Postprocessor
constructor
A new instance of Postprocessor.
- #process(result) ⇒ Object
Constructor Details
#initialize(proxy) ⇒ Postprocessor
Returns a new instance of Postprocessor.
8 9 10 |
# File 'lib/manacle/proxy/method/constrained.rb', line 8 def initialize(proxy) @constraint = proxy.unproxy end |
Instance Method Details
#process(result) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/manacle/proxy/method/constrained.rb', line 12 def process(result) if @constraint.constrainables.include?(result.class) @constraint.reconstrain(result).proxy else result end end |