reg.api 2 for Ruby