Sha256: 3dff3edfc1b29307bc3896a026b692829473df4d819b72b53f793a0ee84178a1

Contents?: true

Size: 761 Bytes

Versions: 10

Compression:

Stored size: 761 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
    # rubocop:enable Metrics/ParameterLists

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
auther-10.2.3 lib/auther/settings.rb
auther-10.2.2 lib/auther/settings.rb
auther-10.2.1 lib/auther/settings.rb
auther-10.2.0 lib/auther/settings.rb
auther-10.1.0 lib/auther/settings.rb
auther-10.0.0 lib/auther/settings.rb
auther-9.3.0 lib/auther/settings.rb
auther-9.2.0 lib/auther/settings.rb
auther-9.1.0 lib/auther/settings.rb
auther-9.0.0 lib/auther/settings.rb