123456789_123456789_123456789_123456789_123456789_

Class: Redis::Subscription

Relationships & Source Files
Inherits: Object
Defined in: lib/redis/subscribe.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new {|_self| ... } ⇒ Subscription

Yields:

  • (_self)

Yield Parameters:

  • _self (Subscription)

    the object that the method was called on

[ GitHub ]

  
# 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 message(&block)
  @callbacks["message"] = block
end

#pmessage(&block)

[ GitHub ]

  
# File 'lib/redis/subscribe.rb', line 110

def pmessage(&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 smessage(&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