Class: EventStoreRuby::EventSubscription

Inherits:
Object
  • Object
show all
Defined in:
lib/eventstore_ruby/event_subscription.rb

Overview

Represents an active subscription to an EventStore.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (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

#unsubscribeObject



12
13
14
# File 'lib/eventstore_ruby/event_subscription.rb', line 12

def unsubscribe
  @unsubscribe_proc.call
end