Class: Auther::Settings
- Inherits:
-
Struct
- Object
- Struct
- Auther::Settings
- Defined in:
- lib/auther/settings.rb
Overview
Represents Auther settings.
Instance Attribute Summary collapse
-
#accounts ⇒ Object
Returns the value of attribute accounts.
-
#label ⇒ Object
Returns the value of attribute label.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #find_account(name) ⇒ Object
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize ⇒ Settings
Returns a new instance of Settings.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/auther/settings.rb', line 6 def initialize(*) super self[:title] ||= "Authorization" self[:label] ||= "Authorization" self[:secret] ||= "" self[:accounts] ||= [] self[:url] ||= "/login" self[:logger] ||= LOGGER end |
Instance Attribute Details
#accounts ⇒ Object
Returns the value of attribute accounts
5 6 7 |
# File 'lib/auther/settings.rb', line 5 def accounts @accounts end |
#label ⇒ Object
Returns the value of attribute label
5 6 7 |
# File 'lib/auther/settings.rb', line 5 def label @label end |
#logger ⇒ Object
Returns the value of attribute logger
5 6 7 |
# File 'lib/auther/settings.rb', line 5 def logger @logger end |
#secret ⇒ Object
Returns the value of attribute secret
5 6 7 |
# File 'lib/auther/settings.rb', line 5 def secret @secret end |
#title ⇒ Object
Returns the value of attribute title
5 6 7 |
# File 'lib/auther/settings.rb', line 5 def title @title end |
#url ⇒ Object
Returns the value of attribute url
5 6 7 |
# File 'lib/auther/settings.rb', line 5 def url @url end |
Instance Method Details
#find_account(name) ⇒ Object
17 |
# File 'lib/auther/settings.rb', line 17 def find_account(name) = accounts.find { |account| account.fetch(:name) == name } |