Class: Seymour::Store::Base
- Inherits:
-
Object
- Object
- Seymour::Store::Base
- Defined in:
- lib/seymour/store/base.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #activity_ids ⇒ Object
- #bulk_push(activities) ⇒ Object
-
#initialize(key, options = {}) ⇒ Base
constructor
A new instance of Base.
- #max_size ⇒ Object
- #redis ⇒ Object
- #remove(activity) ⇒ Object
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, = {}) @key = key @options = end |
Instance Attribute Details
#key ⇒ Object
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_ids ⇒ Object
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_size ⇒ Object
19 20 21 |
# File 'lib/seymour/store/base.rb', line 19 def max_size 100 end |
#redis ⇒ Object
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 |