Sha256: 73a99d27238fcf5f711b614d76d6bae3246ef47d1765f9aa807a58bb497ca27b
Contents?: true
Size: 661 Bytes
Versions: 7
Compression:
Stored size: 661 Bytes
Contents
module Smess class Auto < Output attr_accessor :output_name def validate_config end def deliver out = output_for sms.to out.deliver.merge({sent_with: output_name}) end def get_output_name_for_msisdn(msisdn) 3.downto(0).each do |index| return Smess.config.output_by_country_code[msisdn[0..index]] if Smess.config.output_by_country_code.key? msisdn[0..index] end Smess.config.default_output end def output_for(msisdn) @output_name = get_output_name_for_msisdn(msisdn) output = Smess.named_output_instance( output_name ) output.sms = sms output end end end
Version data entries
7 entries across 7 versions & 1 rubygems