Class: EventStoreRuby::EventSubscription
- Inherits:
-
Object
- Object
- EventStoreRuby::EventSubscription
- Defined in:
- lib/eventstore_ruby/event_subscription.rb
Overview
Represents an active subscription to an EventStore.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id, unsubscribe_proc) ⇒ EventSubscription
constructor
A new instance of EventSubscription.
- #unsubscribe ⇒ Object
Constructor Details
#initialize(id, unsubscribe_proc) ⇒ EventSubscription
Returns a new instance of EventSubscription.
6 7 8 9 10 |
# File 'lib/eventstore_ruby/event_subscription.rb', line 6 def initialize(id, unsubscribe_proc) @id = id @unsubscribe_proc = unsubscribe_proc freeze end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/eventstore_ruby/event_subscription.rb', line 4 def id @id end |
Instance Method Details
#unsubscribe ⇒ Object
12 13 14 |
# File 'lib/eventstore_ruby/event_subscription.rb', line 12 def unsubscribe @unsubscribe_proc.call end |