Class: Auther::Settings

Inherits:
Struct
  • Object
show all
Defined in:
lib/auther/settings.rb

Overview

Represents Auther settings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

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

#accountsObject

Returns the value of attribute accounts

Returns:

  • (Object)

    the current value of accounts



5
6
7
# File 'lib/auther/settings.rb', line 5

def accounts
  @accounts
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



5
6
7
# File 'lib/auther/settings.rb', line 5

def label
  @label
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger



5
6
7
# File 'lib/auther/settings.rb', line 5

def logger
  @logger
end

#secretObject

Returns the value of attribute secret

Returns:

  • (Object)

    the current value of secret



5
6
7
# File 'lib/auther/settings.rb', line 5

def secret
  @secret
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



5
6
7
# File 'lib/auther/settings.rb', line 5

def title
  @title
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of 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 (name) = accounts.find { || .fetch(:name) == name }