Class: RSpecPubsub::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-pubsub-formatter.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeChannel

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_nameObject



76
77
78
# File 'lib/rspec-pubsub-formatter.rb', line 76

def channel_name
  @channel_name || "pubsub_formatter"
end

Instance Attribute Details

#redisObject (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