Use an `only_if` guard instead of vanilla Ruby

Like it says on the tin; more Chef-like.

This is a bit of an opinionated change, so feel free to not merge it if you disagree.
@jespada yeah, that would apply if we’re setting an attribute, but here, we’re just using it as part of the resource name. This all shakes out just fine in compilation, as the attributes are computed prior to the resources.