Class: CanvasSync::JobBatches::Batch::RedisProxy
- Inherits:
-
Object
- Object
- CanvasSync::JobBatches::Batch::RedisProxy
show all
- Defined in:
- lib/canvas_sync/job_batches/batch.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
560
561
562
563
564
|
# File 'lib/canvas_sync/job_batches/batch.rb', line 560
def method_missing(method_name, *arguments, &block)
Batch.redis do |r|
r.send(method_name, *arguments, &block)
end
end
|
Instance Method Details
#multi(*args, &block) ⇒ Object
527
528
529
530
531
532
533
|
# File 'lib/canvas_sync/job_batches/batch.rb', line 527
def multi(*args, &block)
Batch.redis do |r|
r.multi(*args) do |r|
block.call(r)
end
end
end
|
#pipelined(*args, &block) ⇒ Object
535
536
537
538
539
540
541
|
# File 'lib/canvas_sync/job_batches/batch.rb', line 535
def pipelined(*args, &block)
Batch.redis do |r|
r.pipelined(*args) do |r2|
block.call(r2 || r)
end
end
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
566
567
568
|
# File 'lib/canvas_sync/job_batches/batch.rb', line 566
def respond_to_missing?(method_name, include_private = false)
super || Redis.method_defined?(method_name)
end
|
#uget(key) ⇒ Object
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
|
# File 'lib/canvas_sync/job_batches/batch.rb', line 543
def uget(key)
Batch.redis do |r|
case r.type(key)
when 'string'
r.get(key)
when 'list'
r.lrange(key, 0, -1)
when 'hash'
r.hgetall(key)
when 'set'
r.smembers(key)
when 'zset'
r.zrange(key, 0, -1)
end
end
end
|