Class: ActionTexter::TestClient

Inherits:
Client
  • Object
show all
Defined in:
lib/action_texter/test.rb

Overview

A client that doesn't send any message but instead stores them on an array.

Instance Method Summary collapse

Methods inherited from Client

default, default=, setup, #to_s

Constructor Details

#initializeTestClient

Returns a new instance of TestClient.


37
38
39
# File 'lib/action_texter/test.rb', line 37

def initialize
  @@deliveries = []
end

Instance Method Details

#deliver(message) ⇒ Object


41
42
43
44
# File 'lib/action_texter/test.rb', line 41

def deliver(message)
  @@deliveries << message
  ActionTexter::TestResponse.new(message)
end

#deliveriesArray<Message>

All the delivered messages so far.

Returns:

  • (Array<Message>)

    delivered messages.


49
50
51
# File 'lib/action_texter/test.rb', line 49

def deliveries
  @@deliveries
end