Class: Proscenium::Railtie

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/proscenium/railtie.rb

Class Method Summary collapse

Class Method Details

.mounted_pathObject



111
112
113
# File 'lib/proscenium/railtie.rb', line 111

def mounted_path
  Proscenium::Railtie.routes.find_script_name({})
end

.websocketObject



95
96
97
98
99
100
101
102
103
104
105
# File 'lib/proscenium/railtie.rb', line 95

def websocket
  return unless config.proscenium.auto_refresh

  cable = ActionCable::Server::Configuration.new
  cable.cable = { adapter: 'async' }.with_indifferent_access
  cable.mount_path = config.proscenium.cable_mount_path
  cable.connection_class = -> { Proscenium::Connection }
  cable.logger = config.proscenium.cable_logger

  @websocket ||= ActionCable::Server::Base.new(config: cable)
end

.websocket_mount_pathObject



107
108
109
# File 'lib/proscenium/railtie.rb', line 107

def websocket_mount_path
  "#{mounted_path}#{config.proscenium.cable_mount_path}" if websocket
end