Class: RSpecPubsub::Channel
- Inherits:
-
Object
- Object
- RSpecPubsub::Channel
- Defined in:
- lib/rspec-pubsub-formatter.rb
Class Attribute Summary collapse
Instance Attribute Summary collapse
-
#redis ⇒ Object
readonly
Returns the value of attribute redis.
Instance Method Summary collapse
-
#initialize ⇒ Channel
constructor
A new instance of Channel.
- #publish(status) ⇒ Object
Constructor Details
#initialize ⇒ Channel
Returns a new instance of Channel.
81 82 83 |
# File 'lib/rspec-pubsub-formatter.rb', line 81 def initialize @redis = Redis.new end |
Class Attribute Details
.channel_name ⇒ Object
76 77 78 |
# File 'lib/rspec-pubsub-formatter.rb', line 76 def channel_name @channel_name || "pubsub_formatter" end |
Instance Attribute Details
#redis ⇒ Object (readonly)
Returns the value of attribute redis.
72 73 74 |
# File 'lib/rspec-pubsub-formatter.rb', line 72 def redis @redis end |
Instance Method Details
#publish(status) ⇒ Object
85 86 87 |
# File 'lib/rspec-pubsub-formatter.rb', line 85 def publish(status) redis.publish(self.class.channel_name, status.to_json) end |