Class: LiveCable::Testing::TestCableConnection
- Inherits:
-
Object
- Object
- LiveCable::Testing::TestCableConnection
- Defined in:
- lib/live_cable/testing/test_cable_connection.rb
Overview
Stand-in for an ActionCable connection exposing identified_by values (e.g. current_user) to components and their templates.
Instance Attribute Summary collapse
- #identifiers ⇒ Set<Symbol> readonly
Instance Method Summary collapse
-
#initialize(identifiers = {}) ⇒ TestCableConnection
constructor
A new instance of TestCableConnection.
Constructor Details
#initialize(identifiers = {}) ⇒ TestCableConnection
Returns a new instance of TestCableConnection.
11 12 13 14 15 16 17 18 |
# File 'lib/live_cable/testing/test_cable_connection.rb', line 11 def initialize(identifiers = {}) identifiers = identifiers.symbolize_keys @identifiers = identifiers.keys.to_set identifiers.each do |name, value| define_singleton_method(name) { value } end end |
Instance Attribute Details
#identifiers ⇒ Set<Symbol> (readonly)
9 10 11 |
# File 'lib/live_cable/testing/test_cable_connection.rb', line 9 def identifiers @identifiers end |