Sha256: cb64391d69522ddd091e5fa3e7c241224dbdfd4879ba31bc4fe53f01b68ccb03

Contents?: true

Size: 544 Bytes

Versions: 2

Compression:

Stored size: 544 Bytes

Contents

module Errdo
  # rubocop:disable MutableConstant
  EXTENSIONS = []
  AUTHORIZATION_ADAPTERS = {}
  # rubocop:enable MutableConstant

  # The extension may define various adapters (e.g., for authorization) and
  # register those via the options hash.
  def self.add_extension(extension_key, extension_definition, options = {})
    options.assert_valid_keys(:authorization)

    EXTENSIONS << extension_key

    if options[:authorization]
      AUTHORIZATION_ADAPTERS[extension_key] = extension_definition::AuthorizationAdapter
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
errdo-0.9.1 lib/errdo/extension.rb
errdo-0.9.0 lib/errdo/extension.rb