Class: Turbo::Train::AnycableConfiguration
- Inherits:
-
Object
- Object
- Turbo::Train::AnycableConfiguration
- Defined in:
- lib/turbo/train/config.rb
Instance Attribute Summary collapse
-
#anycable_url ⇒ Object
Returns the value of attribute anycable_url.
-
#broadcast_key ⇒ Object
Returns the value of attribute broadcast_key.
Instance Method Summary collapse
-
#initialize ⇒ AnycableConfiguration
constructor
A new instance of AnycableConfiguration.
- #listen_url(topic) ⇒ Object
- #publish_url ⇒ Object
Constructor Details
#initialize ⇒ AnycableConfiguration
Returns a new instance of AnycableConfiguration.
53 54 55 56 57 |
# File 'lib/turbo/train/config.rb', line 53 def initialize super @anycable_url = 'http://localhost:8080' @broadcast_key = 'test' end |
Instance Attribute Details
#anycable_url ⇒ Object
Returns the value of attribute anycable_url.
51 52 53 |
# File 'lib/turbo/train/config.rb', line 51 def anycable_url @anycable_url end |
#broadcast_key ⇒ Object
Returns the value of attribute broadcast_key.
51 52 53 |
# File 'lib/turbo/train/config.rb', line 51 def broadcast_key @broadcast_key end |
Instance Method Details
#listen_url(topic) ⇒ Object
63 64 65 |
# File 'lib/turbo/train/config.rb', line 63 def listen_url(topic, **) "#{@anycable_url}/events?stream=#{Turbo::Train.signed_stream_name(topic)}" end |
#publish_url ⇒ Object
59 60 61 |
# File 'lib/turbo/train/config.rb', line 59 def publish_url "#{@anycable_url}/_broadcast" end |