lib/liszt/redis_list.rb
# Swap the position of the given id with the one below it. If it's at the
# bottom of the list or not present in the list, do nothing.
# @param [Fixnum] id
Swap the position of the given id with the one below it. If it's at the
bottom of the list or not present in the list, do nothing.
Swap the position of the given id with the one below it . If it ' s at the bottom of the list or not present in the list do nothing .
def move_down(id)
      with_lock do
        position = index(id)
        if position.nil? or position == (length - 1)
          nil
        else
          next_id = get(position + 1)
          redis.multi do
            set(position + 1, id)
            set(position, next_id)
          end
        end
      end
    end
def move_down ( id ) with_lock do position = index ( id ) if position . nil? or position == ( length - 1 ) nil else next_id = get ( position + 1 ) redis . multi do set ( position + 1 , id ) set ( position , next_id ) end end end end
Swap the position of the given id with the one below it.
Swap the position of the given id with the one below it .
id
<not_specific>
<not_specific>
None