Sha256: 9244cc3a4fa51fcb3547ccd825b3241c26a6411785757af6c057a0df3e134ba4

Contents?: true

Size: 551 Bytes

Versions: 30

Compression:

Stored size: 551 Bytes

Contents

# frozen_string_literal: true

module Auther
  # Represents Auther settings.
  Settings = Struct.new :title, :label, :secret, :accounts, :url, :logger, keyword_init: true do
    def initialize *arguments
      super

      self[:title] ||= "Authorization"
      self[:label] ||= "Authorization"
      self[:secret] ||= ""
      self[:accounts] ||= []
      self[:url] ||= "/login"
      self[:logger] ||= Auther::NullLogger.new STDOUT
    end

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

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
auther-15.0.2 lib/auther/settings.rb
auther-15.0.1 lib/auther/settings.rb
auther-15.0.0 lib/auther/settings.rb
auther-14.0.3 lib/auther/settings.rb
auther-14.0.2 lib/auther/settings.rb
auther-14.0.1 lib/auther/settings.rb
auther-14.0.0 lib/auther/settings.rb
auther-13.6.0 lib/auther/settings.rb
auther-13.5.0 lib/auther/settings.rb
auther-13.4.0 lib/auther/settings.rb
auther-13.3.0 lib/auther/settings.rb
auther-13.2.3 lib/auther/settings.rb
auther-13.2.2 lib/auther/settings.rb
auther-13.2.1 lib/auther/settings.rb
auther-13.2.0 lib/auther/settings.rb
auther-13.1.0 lib/auther/settings.rb
auther-13.0.0 lib/auther/settings.rb
auther-12.2.0 lib/auther/settings.rb
auther-12.1.0 lib/auther/settings.rb
auther-12.0.3 lib/auther/settings.rb