Class: Upkeep::Delivery::TurboStreams::Batch
- Inherits:
-
Data
- Object
- Data
- Upkeep::Delivery::TurboStreams::Batch
- Defined in:
- lib/upkeep/delivery/turbo_streams.rb
Instance Attribute Summary collapse
-
#streams ⇒ Object
readonly
Returns the value of attribute streams.
Instance Method Summary collapse
Instance Attribute Details
#streams ⇒ Object (readonly)
Returns the value of attribute streams
107 108 109 |
# File 'lib/upkeep/delivery/turbo_streams.rb', line 107 def streams @streams end |
Instance Method Details
#envelope_for(subscriber_id) ⇒ Object
114 115 116 |
# File 'lib/upkeep/delivery/turbo_streams.rb', line 114 def envelope_for(subscriber_id) Envelope.subscriber(subscriber_id, streams.select { |stream| stream.for_subscriber?(subscriber_id) }) end |
#envelopes ⇒ Object
108 109 110 111 112 |
# File 'lib/upkeep/delivery/turbo_streams.rb', line 108 def envelopes return [] if streams.empty? shared_envelopes + subscriber_envelopes end |
#report ⇒ Object
118 119 120 121 122 123 |
# File 'lib/upkeep/delivery/turbo_streams.rb', line 118 def report { streams: streams.map(&:report), envelopes: envelopes.map(&:report) } end |