Class: ActionSms::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/action_sms_gateways/connection_adapters/tropo.rb,
lib/action_sms_gateways/connection_adapters/sms_global.rb

Class Method Summary collapse

Class Method Details

.sms_global_connection(config) ⇒ Object

:nodoc:



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/action_sms_gateways/connection_adapters/sms_global.rb', line 5

def self.sms_global_connection(config) #:nodoc:
  if config[:environment].to_s == "test"
    test_helper = File.expand_path(File.dirname(__FILE__) + '/test_helpers/sms_global')
    if File.exists?("#{test_helper}.rb")
      require test_helper
      ConnectionAdapters::SMSGlobalAdapter.class_eval do
        include TestHelpers::SMSGlobal
      end
    end
  end
  ConnectionAdapters::SMSGlobalAdapter.new(config)
end

.tropo_connection(config) ⇒ Object

:nodoc:



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/action_sms_gateways/connection_adapters/tropo.rb', line 5

def self.tropo_connection(config) #:nodoc:
  if config[:environment].to_s == "test"
    test_helper = File.expand_path(File.dirname(__FILE__) + '/test_helpers/tropo')
    if File.exists?("#{test_helper}.rb")
      require test_helper
      ConnectionAdapters::TropoAdapter.class_eval do
        include TestHelpers::Tropo
      end
    end
  end
  ConnectionAdapters::TropoAdapter.new(config)
end