Class: Redis::Subscription
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/redis/subscribe.rb |
Class Method Summary
- .new {|_self| ... } ⇒ Subscription constructor
Instance Attribute Summary
- #callbacks readonly
Instance Method Summary
Constructor Details
.new {|_self| ... } ⇒ Subscription
# File 'lib/redis/subscribe.rb', line 85
def initialize @callbacks = {} yield(self) end
Instance Attribute Details
#callbacks (readonly)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 83
attr :callbacks
Instance Method Details
#message(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 98
def (&block) @callbacks["message"] = block end
#pmessage(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 110
def (&block) @callbacks["pmessage"] = block end
#psubscribe(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 102
def psubscribe(&block) @callbacks["psubscribe"] = block end
#punsubscribe(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 106
def punsubscribe(&block) @callbacks["punsubscribe"] = block end
#smessage(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 122
def (&block) @callbacks["smessage"] = block end
#ssubscribe(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 114
def ssubscribe(&block) @callbacks["ssubscribe"] = block end
#subscribe(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 90
def subscribe(&block) @callbacks["subscribe"] = block end
#sunsubscribe(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 118
def sunsubscribe(&block) @callbacks["sunsubscribe"] = block end
#unsubscribe(&block)
[ GitHub ]# File 'lib/redis/subscribe.rb', line 94
def unsubscribe(&block) @callbacks["unsubscribe"] = block end