Class: Auther::Settings
- Inherits:
-
Object
- Object
- Auther::Settings
- Defined in:
- lib/auther/settings.rb
Overview
Represents Auther settings.
Instance Attribute Summary collapse
-
#accounts ⇒ Object
readonly
Returns the value of attribute accounts.
-
#auth_url ⇒ Object
readonly
Returns the value of attribute auth_url.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#find_account(name) ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(title: "Authorization", label: "Authorization", secret: "", accounts: [], auth_url: "/login", logger: Auther::NullLogger.new(STDOUT)) ⇒ Settings
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(title: "Authorization", label: "Authorization", secret: "", accounts: [], auth_url: "/login", logger: Auther::NullLogger.new(STDOUT)) ⇒ Settings
rubocop:disable Metrics/ParameterLists
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/auther/settings.rb', line 9 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 |
Instance Attribute Details
#accounts ⇒ Object (readonly)
Returns the value of attribute accounts.
6 7 8 |
# File 'lib/auther/settings.rb', line 6 def accounts @accounts end |
#auth_url ⇒ Object (readonly)
Returns the value of attribute auth_url.
6 7 8 |
# File 'lib/auther/settings.rb', line 6 def auth_url @auth_url end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'lib/auther/settings.rb', line 6 def label @label end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/auther/settings.rb', line 6 def logger @logger end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
6 7 8 |
# File 'lib/auther/settings.rb', line 6 def secret @secret end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/auther/settings.rb', line 6 def title @title end |
Instance Method Details
#find_account(name) ⇒ Object
rubocop:enable Metrics/ParameterLists
25 26 27 |
# File 'lib/auther/settings.rb', line 25 def find_account name accounts.find { |account| account.fetch(:name) == name } end |