class Sohm::MutableSet

Public Instance Methods

<<(model)
Alias for: add
add(model) click to toggle source

Add a model directly to the set.

Example:

user = User.create
post = Post.create

user.posts.add(post)
# File lib/sohm.rb, line 455
def add(model)
  redis.call("SADD", key, model.id)
end
Also aliased as: <<
delete(model) click to toggle source

Remove a model directly from the set.

Example:

user = User.create
post = Post.create

user.posts.delete(post)
# File lib/sohm.rb, line 470
def delete(model)
  redis.call("SREM", key, model.id)
end