You can also define methods on the [action](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/face/node/clean.rb#L60), which is a much more conventional way of adding methods then defining the method inside of another method.