Class: Hyperloop::ChannelBroadcastRegulation
Instance Attribute Summary
Attributes inherited from Regulation
#klass
Class Method Summary
collapse
Methods inherited from Regulation
allowed_opts, #auto_connect_disabled?, #initialize, #opts, #regulate_for, regulations, #regulations, wrap_policy
Class Method Details
.add_regulation(channel, opts = {}, ®ulation) ⇒ Object
264
265
266
|
# File 'lib/hyper-operation/transport/policy.rb', line 264
def add_regulation(channel, opts={}, ®ulation)
regulations_to_channels[regulation] << super
end
|
.broadcast(policy) ⇒ Object
268
269
270
271
272
273
274
275
276
|
# File 'lib/hyper-operation/transport/policy.rb', line 268
def broadcast(policy)
regulations_to_channels.each do |regulation, channels|
wrapped_policy = wrap_policy(policy, regulation)
channels.each do |channel|
regulation.call wrapped_policy
policy.send_unassigned_sets_to channel.klass
end
end
end
|
.regulations_to_channels ⇒ Object
278
279
280
|
# File 'lib/hyper-operation/transport/policy.rb', line 278
def regulations_to_channels
@regulations_to_channels ||= Hash.new { |hash, key| hash[key] = [] }
end
|