Sha256: 82cf45cb7be46e35a6646b0985e17f1a7408433df0a999d2863df04c0c5d735f

Contents?: true

Size: 321 Bytes

Versions: 1

Compression:

Stored size: 321 Bytes

Contents

module Hari
  class Relation < Entity
    module LinkedList
      extend self

      def create(rel)
        Relation::DIRECTIONS.each { |d| Hari.redis.lpush rel.key(d), rel.id }
      end

      def delete(rel)
        Relation::DIRECTIONS.each { |d| Hari.redis.lrem rel.key(d), 1, rel.id }
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hari-0.0.3 lib/hari/relation/linked_list.rb