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 355

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

Class Method Details

.wrap(pattern)

[ GitHub ]

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

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 343

attr_reader :pattern, :exclusions

#pattern (readonly)

[ GitHub ]

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

attr_reader :pattern, :exclusions

Instance Method Details

#===(name)

[ GitHub ]

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

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

#unsubscribe!(name)

[ GitHub ]

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

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