Sha256: a9ec4150fc1b13fa3ea39fd1c64a732f86a1d6f7fb9965fec65e2bcb19d41f6c

Contents?: true

Size: 492 Bytes

Versions: 2

Compression:

Stored size: 492 Bytes

Contents

module TFA
  module Twilio
    @@acc_sid = ENV["TWILIO_ACCOUNT_SID"]
    @@auth_token = ENV["TWILIO_AUTH_TOKEN"]
    @@sending_phone = ENV["TWILIO_SENDING_PHONE"]
    @@client = ::Twilio::REST::Client.new(@@acc_sid, @@auth_token)
    
    mattr_reader :acc_sid
    mattr_reader :auth_token
    mattr_accessor :sending_phone

    def self.send_msg(message, to:)
      @@client.messages.create(
        body: message,
        from: @@sending_phone,
        to: to
      ).sid
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
2fa-0.0.2 lib/TFA/twilio.rb
2fa-0.0.1 lib/TFA/twilio.rb