class Celluloid::Notifications::Subscriber - celluloid-0.16.0 Documentation

# class Celluloid::Notifications::Subscriber

### Attributes

actor[RW]
method[RW]
pattern[RW]

### Public Class Methods

new(actor, pattern, method) click to toggle source

    # File lib/celluloid/notifications.rb, line 63
    def initialize(actor, pattern, method)
      @actor = actor
      @pattern = pattern
      @method = method
    end

### Public Instance Methods

matches?(subscriber_or_pattern) click to toggle source

    # File lib/celluloid/notifications.rb, line 77
    def matches?(subscriber_or_pattern)
      self === subscriber_or_pattern ||
        @pattern && @pattern === subscriber_or_pattern
    end

publish(pattern, *args) click to toggle source

    # File lib/celluloid/notifications.rb, line 69
    def publish(pattern, *args)
      actor.async method, pattern, *args
    end

subscribed_to?(pattern) click to toggle source

    # File lib/celluloid/notifications.rb, line 73
    def subscribed_to?(pattern)
      !pattern || @pattern === pattern.to_s
    end