Well this is not much about ruby. This part is Yast UI and / or ycp -> ruby conversion specific. It will work written this way. However, we (yast team) tries to improve code quality when touching it, bcs it currently is poor. So, above is simple suggestion how to achieve this.