Class: LiveCable::Component
- Inherits:
-
Object
- Object
- LiveCable::Component
- Includes:
- ActiveSupport::Rescuable, Broadcasting, Events, Identification, Lifecycle, MethodDependencyTracking, ReactiveVariables, Rendering, Streaming
- Defined in:
- lib/live_cable/component.rb,
lib/live_cable/component/events.rb,
lib/live_cable/component/lifecycle.rb,
lib/live_cable/component/rendering.rb,
lib/live_cable/component/streaming.rb,
lib/live_cable/component/broadcasting.rb,
lib/live_cable/component/identification.rb,
lib/live_cable/component/reactive_variables.rb,
lib/live_cable/component/method_dependency_tracking.rb
Defined Under Namespace
Modules: Broadcasting, Events, Identification, Lifecycle, MethodDependencyTracking, ReactiveVariables, Rendering, Streaming
Instance Attribute Summary collapse
- #id ⇒ String readonly
-
#live_connection ⇒ Object
Returns the value of attribute live_connection.
Attributes included from ReactiveVariables
Instance Method Summary collapse
-
#initialize(id, **defaults) ⇒ Component
constructor
A new instance of Component.
Methods included from Rendering
#render, #render_in, #rendered_children, #to_partial_path, #variant
Methods included from Events
#dispatch_event, #flush_events
Methods included from Broadcasting
#broadcast, #broadcast_ack, #broadcast_destroy, #broadcast_render, #broadcast_subscribe
Methods included from Lifecycle
#connect, #destroy, #disconnect, #method_missing, #respond_to_missing?, #status, #subscribed?
Methods included from Identification
Methods included from ReactiveVariables
#all_reactive_variables, #apply_defaults, #defaults=, #dirty, #prerender_container
Constructor Details
#initialize(id, **defaults) ⇒ Component
Returns a new instance of Component.
20 21 22 23 24 25 |
# File 'lib/live_cable/component.rb', line 20 def initialize(id, **defaults) @id = self.class.resolve_id(id) @rendered = false @subscribed = false @defaults = defaults end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class LiveCable::Component::Lifecycle
Instance Attribute Details
#id ⇒ String (readonly)
18 19 20 |
# File 'lib/live_cable/component.rb', line 18 def id @id end |
#live_connection ⇒ Object
Returns the value of attribute live_connection.
15 16 17 |
# File 'lib/live_cable/component.rb', line 15 def live_connection @live_connection end |