move common code into a function

use that function to for a boolean confine, in which we check for
product_version >= 10.0.0-MariaDB

n.b.: version_check() needs to be class method. class methods in ruby
are declared as:

     def self.foo()
add feature confine to mysql_grant type