<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _ruby_installed(ret, ruby, user=None):
    '''
    Check to see if given ruby is installed.
    '''
    default = __salt__['rbenv.default'](runas=user)
    for version in __salt__['rbenv.versions'](user):
        if version == ruby:
            ret['result'] = True
            ret['comment'] = 'Requested ruby exists'
            ret['default'] = default == ruby
            break

    return ret