Class: Flamingo::Subscription
- Inherits:
-
Object
- Object
- Flamingo::Subscription
- Defined in:
- lib/flamingo/subscription.rb
Overview
Track stream subscriptions in the Redis db.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(name) ⇒ Subscription
constructor
A new instance of Subscription.
- #save ⇒ Object
Constructor Details
#initialize(name) ⇒ Subscription
Returns a new instance of Subscription.
21 22 23 |
# File 'lib/flamingo/subscription.rb', line 21 def initialize(name) self.name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/flamingo/subscription.rb', line 20 def name @name end |
Class Method Details
.all ⇒ Object
7 8 9 10 11 |
# File 'lib/flamingo/subscription.rb', line 7 def all Flamingo.redis.smembers("subscriptions").map do |name| new(name) end end |
.find(name) ⇒ Object
13 14 15 16 17 |
# File 'lib/flamingo/subscription.rb', line 13 def find(name) if Flamingo.redis.sismember("subscriptions",name) Subscription.new(name) end end |