Here at SPARQCode we have a use case where we have objects that want to delegate specific methods to a “template”. The template’s value should take precedence if present, otherwise the value of the “child” should be used.
The easiest way to see how this gem behaves is to look at the rspec tests.
Generally speaking you just need an object that responds to “template”. More specifically you need to include the ProxyForTemplate module, and then use template_method to tell the gem which method calls should be delegated. The tests have a pretty comprehensive example of how this works.