Sha256: 67de2fadb6ce456d692c0909abc2e819b4a06d2767252b51787a858006f6426d

Contents?: true

Size: 325 Bytes

Versions: 5

Compression:

Stored size: 325 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

5 entries across 5 versions & 1 rubygems

Version Path
yopass-1.1.2 lib/yopass/sms_provider.rb
yopass-1.1.1 lib/yopass/sms_provider.rb
yopass-1.1.0 lib/yopass/sms_provider.rb
yopass-1.0.1 lib/yopass/sms_provider.rb
yopass-1.0.0 lib/yopass/sms_provider.rb