Class: Outbox::Clients::TestClient

Inherits:
Base
  • Object
show all
Defined in:
lib/outbox/clients/test_client.rb

Overview

The TestClient is a bare bones client that does nothing. It is useful when you are testing.

It also provides a template of the minimum methods required to make a custom client.

Instance Attribute Summary

Attributes inherited from Base

#settings

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

defaults, #initialize

Constructor Details

This class inherits a constructor from Outbox::Clients::Base

Class Method Details

.deliveriesObject

Provides a store of all the message sent with the TestClient so you can check them.



11
12
13
# File 'lib/outbox/clients/test_client.rb', line 11

def self.deliveries
  @@deliveries ||= []
end

Instance Method Details

#deliver(message) ⇒ Object



15
16
17
# File 'lib/outbox/clients/test_client.rb', line 15

def deliver(message)
  self.class.deliveries << message
end