Sha256: 98e6d2cfeadc162f85253e956df763e03e707642a00c73ec6297184dd28e0426

Contents?: true

Size: 537 Bytes

Versions: 14

Compression:

Stored size: 537 Bytes

Contents

module HaveAPI::GoClient
  module Authentication; end

  module AuthenticationMethods
    # @param name [Symbol]
    # @param klass [Class]
    def self.register(name, klass)
      @methods ||= {}
      @methods[name] = klass
    end

    # @param name [String]
    def self.get(name)
      @methods[name.to_sym]
    end

    # @param api_version [ApiVersion]
    # @param name [String]
    def self.new(api_version, name, *)
      klass = get(name) || Authentication::Unsupported
      klass.new(api_version, name, *)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
haveapi-go-client-0.25.0 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.24.0 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.7 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.6 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.5 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.4 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.3 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.2 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.1 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.23.0 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.22.1 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.22.0 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.21.1 lib/haveapi/go_client/authentication_methods.rb
haveapi-go-client-0.21.0 lib/haveapi/go_client/authentication_methods.rb