Class: Redis::Attrs::FilteredList
- Inherits:
-
List
- Object
- List
- Redis::Attrs::FilteredList
- Defined in:
- lib/redis-attrs/objects_extensions.rb
Instance Method Summary collapse
- #delete(name, count = 0) ⇒ Object
-
#insert(where, pivot, value) ⇒ Object
Add a member before or after pivot in the list.
- #push(value) ⇒ Object
-
#unshift(value) ⇒ Object
Add a member to the start of the list.
Instance Method Details
#delete(name, count = 0) ⇒ Object
25 26 27 28 |
# File 'lib/redis-attrs/objects_extensions.rb', line 25 def delete(name, count = 0) name = [:filter].call(name) if [:filter] super end |
#insert(where, pivot, value) ⇒ Object
Add a member before or after pivot in the list. Redis: LINSERT
11 12 13 14 15 16 17 |
# File 'lib/redis-attrs/objects_extensions.rb', line 11 def insert(where, pivot, value) if [:filter] value = [:filter].call(value) pivot = [:filter].call(pivot) end super end |
#push(value) ⇒ Object
5 6 7 8 |
# File 'lib/redis-attrs/objects_extensions.rb', line 5 def push(value) value = [:filter].call(value) if [:filter] super end |
#unshift(value) ⇒ Object
Add a member to the start of the list. Redis: LPUSH
20 21 22 23 |
# File 'lib/redis-attrs/objects_extensions.rb', line 20 def unshift(value) value = [:filter].call(value) if [:filter] super end |