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