lib/cellular/backends/twilio.rb in cellular-2.1.0 vs lib/cellular/backends/twilio.rb in cellular-2.2.0
- old
+ new
@@ -1,22 +1,23 @@
require 'httparty'
module Cellular
module Backends
+ # Twilio backend (https://www.twilio.com)
class Twilio < Backend
# Documentation: https://www.twilio.com/docs/api/rest
- API_VERSION = '2010-04-01'
- BASE_URL = 'https://api.twilio.com/'
+ API_VERSION = '2010-04-01'.freeze
+ BASE_URL = 'https://api.twilio.com/'.freeze
API_URL = BASE_URL + API_VERSION
HTTP_HEADERS = {
'Accept' => 'application/json',
'Accept-Charset' => 'utf-8',
'User-Agent' => "cellular/#{Cellular::VERSION}" \
" (#{RUBY_ENGINE}/#{RUBY_PLATFORM}" \
" #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL})"
- }
+ }.freeze
def self.deliver(options = {})
request_queue = {}
recipients_batch(options).each_with_index do |recipient, index|
options[:batch] = recipient
@@ -69,9 +70,8 @@
[options[:recipient]]
else
options[:recipients]
end
end
-
end
end
end