Sha256: aab07c6f7df41ae03ed4ac0c3603d6ab0d08224f6b216ad439954e1735ce7de0

Contents?: true

Size: 717 Bytes

Versions: 4

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

module Auther
  # Represents Auther settings.
  class Settings
    attr_reader :title, :label, :secret, :accounts, :auth_url, :logger

    # rubocop:disable Metrics/ParameterLists
    def initialize title: "Authorization",
                   label: "Authorization",
                   secret: "",
                   accounts: [],
                   auth_url: "/login",
                   logger: Auther::NullLogger.new(STDOUT)

      @title = title
      @label = label
      @secret = secret
      @accounts = accounts
      @auth_url = auth_url
      @logger = logger
    end

    def find_account name
      accounts.find { |account| account.fetch(:name) == name }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
auther-8.1.1 lib/auther/settings.rb
auther-8.1.0 lib/auther/settings.rb
auther-8.0.0 lib/auther/settings.rb
auther-7.1.0 lib/auther/settings.rb