Sha256: f190d95f90f930b21bafb3e4070f577d8e4b5ccdca584cd1287326abf88133fa

Contents?: true

Size: 323 Bytes

Versions: 1

Compression:

Stored size: 323 Bytes

Contents

class Kredis::Types::List < Kredis::Proxy
  def elements
    lrange(0, -1) || []
  end

  def remove(elements)
    Array(elements).each { |element| lrem 0, element }
  end

  def prepend(elements)
    lpush elements if Array(elements).any?
  end

  def append(elements)
    rpush elements if Array(elements).any?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kredis-0.1.1 lib/kredis/types/list.rb