Class: Space::Events::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/space/events/subscription.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Subscription) initialize(observer, types)

A new instance of Subscription



6
7
8
9
# File 'lib/space/events/subscription.rb', line 6

def initialize(observer, types)
  @observer = observer
  @types    = types
end

Instance Attribute Details

- (Object) observer (readonly)

Returns the value of attribute observer



4
5
6
# File 'lib/space/events/subscription.rb', line 4

def observer
  @observer
end

- (Object) types (readonly)

Returns the value of attribute types



4
5
6
# File 'lib/space/events/subscription.rb', line 4

def types
  @types
end

Instance Method Details

- (Object) notify(event)



11
12
13
# File 'lib/space/events/subscription.rb', line 11

def notify(event)
  observer.notify(event) if matches?(event)
end