Class: Hyperloop::SendSet
- Defined in:
- lib/hyper-operation/transport/policy.rb
Instance Method Summary collapse
-
#initialize(policy, exclude: nil, white_list: nil) ⇒ SendSet
constructor
A new instance of SendSet.
- #merge(set) ⇒ Object
- #to(*channels) ⇒ Object
Constructor Details
#initialize(policy, exclude: nil, white_list: nil) ⇒ SendSet
Returns a new instance of SendSet.
448 449 450 451 452 453 |
# File 'lib/hyper-operation/transport/policy.rb', line 448 def initialize(policy, exclude: nil, white_list: nil) @policy = policy @policy.add_unassigned_send_set(self) @excluded = exclude.map &:to_sym if exclude @white_list = white_list.map &:to_sym if white_list end |
Instance Method Details
#merge(set) ⇒ Object
455 456 457 458 459 |
# File 'lib/hyper-operation/transport/policy.rb', line 455 def merge(set) set = set.difference(@excluded) if @excluded set = set.intersection(@white_list) if @white_list set end |
#to(*channels) ⇒ Object
444 445 446 |
# File 'lib/hyper-operation/transport/policy.rb', line 444 def to(*channels) @policy.send_set_to(self, channels) end |