Method: DelivereeSms::Nexmo#initialize

Defined in:
lib/deliveree_sms/nexmo.rb

#initialize(content, to_number, from_number, keys) ⇒ Nexmo

Returns a new instance of Nexmo.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/deliveree_sms/nexmo.rb', line 3

def initialize(content, to_number, from_number, keys)
  base64key = Base64.strict_encode64("#{keys[:NEXMO_API_KEY]}:#{keys[:NEXMO_API_SECRET]}")
  @api_url = 'https://rest.nexmo.com/sms/json'
  @headers = {
    'Content-Type' => 'application/json'
  }
  @body = {
    api_key: keys[:NEXMO_API_KEY],
    api_secret: keys[:NEXMO_API_SECRET],
    to: to_number,
    text: content,
    from: from_number
  }
end