Class: Noodles::Websocket::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/noodles/websocket/routing.rb,
lib/noodles/websocket/application.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
# File 'lib/noodles/websocket/application.rb', line 8

def call(env)
  handler = get_handler(env)
  handler.new.call(env)
end

#get_handler(env) ⇒ Object



4
5
6
7
8
9
# File 'lib/noodles/websocket/routing.rb', line 4

def get_handler(env)
  _, handler, after = env['PATH_INFO'].split('/', 3)
  handler = handler.capitalize
  handler += 'Handler'
  Object.const_get(handler)
end