Class: Turbo::Train::AnycableConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/turbo/train/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAnycableConfiguration

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_urlObject

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_keyObject

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_urlObject



59
60
61
# File 'lib/turbo/train/config.rb', line 59

def publish_url
  "#{@anycable_url}/_broadcast"
end