Sha256: 5287dd2db2a3aa8330e6c7223e52391b9d57006088fa8581a72a18bd0a1410c5

Contents?: true

Size: 326 Bytes

Versions: 14

Compression:

Stored size: 326 Bytes

Contents

class SmsProvider
  def self.create(provider, settings)
    begin
      require "yopass/sms_provider/#{provider.downcase}"
    rescue LoadError => e
      raise "Unsupported provider #{provider}: #{e}"
    end
    class_name = provider.split('_').map { |v| v.capitalize }.join
    const_get(class_name).new settings
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
yopass-3.0.7 lib/yopass/sms_provider.rb
yopass-3.0.6 lib/yopass/sms_provider.rb
yopass-3.0.5 lib/yopass/sms_provider.rb
yopass-3.0.4 lib/yopass/sms_provider.rb
yopass-3.0.3 lib/yopass/sms_provider.rb
yopass-3.0.1 lib/yopass/sms_provider.rb
yopass-3.0.0 lib/yopass/sms_provider.rb
yopass-2.2.1 lib/yopass/sms_provider.rb
yopass-2.2.0 lib/yopass/sms_provider.rb
yopass-2.1.1 lib/yopass/sms_provider.rb
yopass-2.1.0 lib/yopass/sms_provider.rb
yopass-2.0.0 lib/yopass/sms_provider.rb
yopass-1.1.5 lib/yopass/sms_provider.rb
yopass-1.1.4 lib/yopass/sms_provider.rb