Class: ActiveSupport::Notifications::Fanout::Subscribers::Matcher
- Defined in:
- activesupport/lib/active_support/notifications/fanout.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#exclusions ⇒ Object
readonly
Returns the value of attribute exclusions.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Class Method Summary collapse
Instance Method Summary collapse
- #===(name) ⇒ Object
-
#initialize(pattern) ⇒ Matcher
constructor
A new instance of Matcher.
- #unsubscribe!(name) ⇒ Object
Constructor Details
#initialize(pattern) ⇒ Matcher
Returns a new instance of Matcher.
127 128 129 130 |
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 127 def initialize(pattern) @pattern = pattern @exclusions = Set.new end |
Instance Attribute Details
#exclusions ⇒ Object (readonly)
Returns the value of attribute exclusions
120 121 122 |
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 120 def exclusions @exclusions end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern
120 121 122 |
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 120 def pattern @pattern end |
Class Method Details
Instance Method Details
#===(name) ⇒ Object
136 137 138 |
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 136 def ===(name) pattern === name && !exclusions.include?(name) end |
#unsubscribe!(name) ⇒ Object
132 133 134 |
# File 'activesupport/lib/active_support/notifications/fanout.rb', line 132 def unsubscribe!(name) exclusions << -name if pattern === name end |