code: def _check_and_install_ruby(ret, ruby, default=False, user=None, opts=None, env=None):
      '''
      Verify that ruby is installed, install if unavailable
      '''
      ret = _check_ruby(ret, ruby, user=user)
      if not ret['result']:
          if __salt__['rvm.install_ruby'](ruby, runas=user, opts=opts, env=env):
              ret['result'] = True
              ret['changes'][ruby] = 'Installed'
              ret['comment'] = 'Successfully installed ruby.'
              ret['default'] = False
          else:
              ret['result'] = False
              ret['comment'] = 'Could not install ruby.'
              return ret
  
      if default:
          __salt__['rvm.set_default'](ruby, runas=user)
  
      return ref _check_and_install_ruby(ret, ruby, default=False, user=None, opts=None, env=None):
      '''
      Verify that ruby is installed, install if unavailable
      '''
      ret = _check_ruby(ret, ruby, user=user)
      if not ret['result']:
          if __salt__['rvm.install_ruby'](ruby, runas=user, opts=opts, env=env):
              ret['result'] = True
              ret['changes'][ruby] = 'Installed'
              ret['comment'] = 'Successfully installed ruby.'
              ret['default'] = False
          else:
              ret['result'] = False
              ret['comment'] = 'Could not install ruby.'
              return ret
  
      if default:
          __salt__['rvm.set_default'](ruby, runas=user)
  
      return ret
docs: Verify that ruby is installed, install if unavailable