Class: Space::Events::Subscription
- Inherits:
-
Object
- Object
- Space::Events::Subscription
- Defined in:
- lib/space/events/subscription.rb
Instance Attribute Summary (collapse)
-
- (Object) observer
readonly
Returns the value of attribute observer.
-
- (Object) types
readonly
Returns the value of attribute types.
Instance Method Summary (collapse)
-
- (Subscription) initialize(observer, types)
constructor
A new instance of Subscription.
- - (Object) notify(event)
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 |