Class: CableX::Channel::CableXChannel
- Inherits:
-
CableX::Cable::Channel
- Object
- ActionCable::Channel::Base
- CableX::Cable::Channel
- CableX::Channel::CableXChannel
- Includes:
- Process::Controller, Process::Request, Process::Response
- Defined in:
- lib/cable_x/channel/cable_x_channel.rb
Overview
CableXChannel class to serve subscription, and cmd execution
Instance Attribute Summary collapse
-
#controller_action_hash ⇒ Object
readonly
Returns the value of attribute controller_action_hash.
-
#ctrl ⇒ Object
readonly
Returns the value of attribute ctrl.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
Instance Method Summary collapse
Methods included from Process::Response
#prepare_response, #set_response
Methods included from Process::Request
Methods included from Process::Controller
#controller_klass, #invoke_controller, #set_controller, #set_controller_hash
Instance Attribute Details
#controller_action_hash ⇒ Object (readonly)
Returns the value of attribute controller_action_hash.
16 17 18 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 16 def controller_action_hash @controller_action_hash end |
#ctrl ⇒ Object (readonly)
Returns the value of attribute ctrl.
16 17 18 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 16 def ctrl @ctrl end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
16 17 18 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 16 def data @data end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
16 17 18 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 16 def request @request end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
16 17 18 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 16 def request_id @request_id end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
16 17 18 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 16 def response @response end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
16 17 18 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 16 def response_body @response_body end |
Instance Method Details
#cmd(data) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 25 def cmd(data) @data = data invoke_controller prepare_response transmit response_body, via: device_id end |
#subscribed ⇒ Object
18 19 20 21 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 18 def subscribed reject unless device_id.present? stream_from device_id end |
#unsubscribed ⇒ Object
23 |
# File 'lib/cable_x/channel/cable_x_channel.rb', line 23 def unsubscribed; end |