Why? What's wrong with the question mark? The function returns boolean. And you can export that function in Yast API easily.

See, for instance: https://github.com/yast/yast-yast2/blob/master/library/system/src/modules/Kernel.rb#L579