Generate a named method to truncate instead of a anonymous lambda

This will generate a named method to truncate the field, instead of using an anonymous proc. See #7 for the original implementation.

@christianblais