123456789_123456789_123456789_123456789_123456789_

Class: ActiveSupport::Notifications::Fanout::Subscribers::Matcher

Do not use. This class is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Inherits: Object
Defined in: activesupport/lib/active_support/notifications/fanout.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(pattern) ⇒ Matcher

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 351

def initialize(pattern)
  @pattern = pattern
  @exclusions = Set.new
end

Class Method Details

.wrap(pattern)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 341

def self.wrap(pattern)
  if String === pattern
    pattern
  elsif pattern.nil?
    AllMessages.new
  else
    new(pattern)
  end
end

Instance Attribute Details

#exclusions (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 339

attr_reader :pattern, :exclusions

#pattern (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 339

attr_reader :pattern, :exclusions

Instance Method Details

#===(name)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 360

def ===(name)
  pattern === name && !exclusions.include?(name)
end

#unsubscribe!(name)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 356

def unsubscribe!(name)
  exclusions << -name if pattern === name
end