Class: Esendex::Account::Dispatcher
- Inherits:
-
Object
- Object
- Esendex::Account::Dispatcher
- Defined in:
- lib/xednese/account/dispatcher.rb
Instance Method Summary collapse
-
#initialize(credentials, reference) ⇒ Dispatcher
constructor
private
A new instance of Dispatcher.
-
#send(body, to) ⇒ Responses::MessageDispatcherHeaders
Sends a message to a single recipient.
Constructor Details
#initialize(credentials, reference) ⇒ Dispatcher
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Dispatcher.
7 8 9 10 |
# File 'lib/xednese/account/dispatcher.rb', line 7 def initialize(credentials, reference) @credentials = credentials @reference = reference end |
Instance Method Details
#send(body, to) ⇒ Responses::MessageDispatcherHeaders
Sends a message to a single recipient.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/xednese/account/dispatcher.rb', line 16 def send(body, to) args = { account_reference: @reference, messages: [{to: to, body: body}] } = Requests::Messages.new(args) Client.post(@credentials, 'v1.0/messagedispatcher', ) do |code, body| Responses::MessageDispatcherHeaders.deserialise(body) end end |