Class: PubsubClient::NullSubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/pubsub_client/null_subscriber.rb

Overview

A null object to act as a subscriber when clients are in dev or test

Defined Under Namespace

Classes: NullResult

Instance Method Summary collapse

Instance Method Details

#listener {|res.data, res| ... } ⇒ Object

Yields:

  • (res.data, res)


21
22
23
24
# File 'lib/pubsub_client/null_subscriber.rb', line 21

def listener(*, &block)
  res = NullResult.new
  yield res.data, res
end

#on_error(&block) ⇒ Object



30
31
32
# File 'lib/pubsub_client/null_subscriber.rb', line 30

def on_error(&block)
  # no-op
end

#subscribeObject



26
27
28
# File 'lib/pubsub_client/null_subscriber.rb', line 26

def subscribe
  # no-op
end