Class: SocketableController
- Inherits:
-
WebsocketRails::BaseController
- Object
- WebsocketRails::BaseController
- SocketableController
- Defined in:
- app/controllers/socketable_controller.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #broadcast(data, to_event) ⇒ Object
- #emit(data, to_event) ⇒ Object
-
#request ⇒ Object
Handle all requests.
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
2 3 4 |
# File 'app/controllers/socketable_controller.rb', line 2 def params @params end |
Instance Method Details
#broadcast(data, to_event) ⇒ Object
18 19 20 |
# File 'app/controllers/socketable_controller.rb', line 18 def broadcast(data, to_event) (to_event, data) end |
#emit(data, to_event) ⇒ Object
14 15 16 |
# File 'app/controllers/socketable_controller.rb', line 14 def emit(data, to_event) (to_event, data) end |
#request ⇒ Object
Handle all requests
5 6 7 8 9 10 11 12 |
# File 'app/controllers/socketable_controller.rb', line 5 def request begin @params = formated_params controller.new.websocket(params, self) rescue Exception => e e end end |