Sha256: 5b9d752515c23dc453181af3ef292fa18a81088ab26a21424753c728b3d9617b

Contents?: true

Size: 503 Bytes

Versions: 103

Compression:

Stored size: 503 Bytes

Contents

require 'rubygems'
require 'redis'

r = Redis.new

r.del 'foo-tags'
r.del 'bar-tags'

puts
p "create a set of tags on foo-tags"

r.sadd 'foo-tags', 'one'
r.sadd 'foo-tags', 'two'
r.sadd 'foo-tags', 'three'

puts
p "create a set of tags on bar-tags"

r.sadd 'bar-tags', 'three'
r.sadd 'bar-tags', 'four'
r.sadd 'bar-tags', 'five'

puts
p 'foo-tags'

p r.smembers('foo-tags')

puts
p 'bar-tags'

p r.smembers('bar-tags')

puts
p 'intersection of foo-tags and bar-tags'

p r.sinter('foo-tags', 'bar-tags')

Version data entries

103 entries across 101 versions & 16 rubygems

Version Path
remq-0.0.3 vendor/bundle/gems/redis-3.0.2/examples/sets.rb
classiccms-0.6.9 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.8 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.7 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.6 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.5 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.4 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.3 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.2 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.6.1 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
redis-3.0.2 examples/sets.rb
classiccms-0.6.0 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.17 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.16 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.15 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.14 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.13 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.12 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.11 vendor/bundle/gems/redis-2.2.2/examples/sets.rb
classiccms-0.5.10 vendor/bundle/gems/redis-2.2.2/examples/sets.rb