def type_info(type, elem)
    scimfo = {
        user: {
            path: '/Users',
            name_attr: 'userName',
            origin_attr: 'origin'
        },
        group: {
            path: '/Groups',
            name_attr: 'displayName',
            origin_attr: 'zoneid'
        },
        client: {
            path: '/oauth/clients',
            name_attr: 'client_id'
        },
        user_id: {
            path: '/ids/Users',
            name_attr: 'userName',
            origin_attr: 'origin',
        },
        group_mapping: {
            path: '/Groups/External',
            name_attr: 'externalGroup',
            origin_attr: 'origin'
        }
    }

    type_info = scimfo[type]

    unless type_info
      raise ArgumentError, "scim resource type must be one of #{scimfo.keys.inspect}"
    end

    value = type_info[elem]

    unless value
      raise ArgumentError, "scim schema element must be one of #{type_info.keys.inspect}"
    end

    value
  end
def type_info(type, elem)
    scimfo = {
        user: {
            path: '/Users',
            name_attr: 'userName',
            origin_attr: 'origin'
        },
        group: {
            path: '/Groups',
            name_attr: 'displayName',
            origin_attr: 'zoneid'
        },
        client: {
            path: '/oauth/clients',
            name_attr: 'client_id'
        },
        user_id: {
            path: '/ids/Users',
            name_attr: 'userName',
            origin_attr: 'origin',
        },
        group_mapping: {
            path: '/Groups/External',
            name_attr: 'externalGroup',
            origin_attr: 'origin'
        }
    }

    type_info = scimfo[type]

    unless type_info
      raise ArgumentError, "scim resource type must be one of #{scimfo.keys.inspect}"
    end

    value = type_info[elem]

    unless value
      raise ArgumentError, "scim schema element must be one of #{type_info.keys.inspect}"
    end

    value
  end
an attempt to hide some scim and uaa oddities