Class: Seymour::Store::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/seymour/store/base.rb

Direct Known Subclasses

List, Zset

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, options = {}) ⇒ Base

Returns a new instance of Base.



6
7
8
9
# File 'lib/seymour/store/base.rb', line 6

def initialize(key, options = {})
  @key = key
  @options = options
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/seymour/store/base.rb', line 4

def key
  @key
end

Instance Method Details

#activity_idsObject



15
16
17
# File 'lib/seymour/store/base.rb', line 15

def activity_ids
  ids
end

#bulk_push(activities) ⇒ Object



23
24
25
26
27
# File 'lib/seymour/store/base.rb', line 23

def bulk_push(activities)
  activities.each do |activity|
    push(activity)
  end
end

#max_sizeObject



19
20
21
# File 'lib/seymour/store/base.rb', line 19

def max_size
  100
end

#redisObject



11
12
13
# File 'lib/seymour/store/base.rb', line 11

def redis
  @redis ||= Seymour.redis
end

#remove(activity) ⇒ Object



29
30
31
# File 'lib/seymour/store/base.rb', line 29

def remove(activity)
  remove_id(activity.id)
end