@@ -122,16 +122,16 @@ def action_methods
122
122
end
123
123
end
124
124
125
- protected
125
+ private
126
126
# action_methods are cached and there is sometimes need to refresh
127
127
# them. ::clear_action_methods! allows you to do that, so next time
128
128
# you run action_methods, they will be recalculated.
129
- def clear_action_methods!
129
+ def clear_action_methods! # :doc:
130
130
@action_methods = nil
131
131
end
132
132
133
133
# Refresh the cached action_methods when a new action_method is added.
134
- def method_added ( name )
134
+ def method_added ( name ) # :doc:
135
135
super
136
136
clear_action_methods!
137
137
end
@@ -189,22 +189,22 @@ def unsubscribe_from_channel # :nodoc:
189
189
end
190
190
end
191
191
192
- protected
192
+ private
193
193
# Called once a consumer has become a subscriber of the channel. Usually the place to setup any streams
194
194
# you want this channel to be sending to the subscriber.
195
- def subscribed
195
+ def subscribed # :doc:
196
196
# Override in subclasses
197
197
end
198
198
199
199
# Called once a consumer has cut its cable connection. Can be used for cleaning up connections or marking
200
200
# users as offline or the like.
201
- def unsubscribed
201
+ def unsubscribed # :doc:
202
202
# Override in subclasses
203
203
end
204
204
205
205
# Transmit a hash of data to the subscriber. The hash will automatically be wrapped in a JSON envelope with
206
206
# the proper channel identifier marked as the recipient.
207
- def transmit ( data , via : nil )
207
+ def transmit ( data , via : nil ) # :doc:
208
208
logger . info "#{ self . class . name } transmitting #{ data . inspect . truncate ( 300 ) } " . tap { |m | m << " (via #{ via } )" if via }
209
209
210
210
payload = { channel_class : self . class . name , data : data , via : via }
@@ -213,33 +213,32 @@ def transmit(data, via: nil)
213
213
end
214
214
end
215
215
216
- def ensure_confirmation_sent
216
+ def ensure_confirmation_sent # :doc:
217
217
return if subscription_rejected?
218
218
@defer_subscription_confirmation_counter . decrement
219
219
transmit_subscription_confirmation unless defer_subscription_confirmation?
220
220
end
221
221
222
- def defer_subscription_confirmation!
222
+ def defer_subscription_confirmation! # :doc:
223
223
@defer_subscription_confirmation_counter . increment
224
224
end
225
225
226
- def defer_subscription_confirmation?
226
+ def defer_subscription_confirmation? # :doc:
227
227
@defer_subscription_confirmation_counter . value > 0
228
228
end
229
229
230
- def subscription_confirmation_sent?
230
+ def subscription_confirmation_sent? # :doc:
231
231
@subscription_confirmation_sent
232
232
end
233
233
234
- def reject
234
+ def reject # :doc:
235
235
@reject_subscription = true
236
236
end
237
237
238
- def subscription_rejected?
238
+ def subscription_rejected? # :doc:
239
239
@reject_subscription
240
240
end
241
241
242
- private
243
242
def delegate_connection_identifiers
244
243
connection . identifiers . each do |identifier |
245
244
define_singleton_method ( identifier ) do
0 commit comments