]>
git.saurik.com Git - redis.git/blob - client-libraries/ruby/examples/list.rb
10 p
"pushing log messages into a LIST"
11 r
.push_tail
'logs', 'some log message'
12 r
.push_tail
'logs', 'another log message'
13 r
.push_tail
'logs', 'yet another log message'
14 r
.push_tail
'logs', 'also another log message'
17 p
'contents of logs LIST'
19 p r
.list_range('logs', 0, -1)
22 p
'Trim logs LIST to last 2 elements(easy circular buffer)'
24 r
.list_trim('logs', -2, -1)
26 p r
.list_range('logs', 0, -1)