Class: Auther::Keymaster

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

Overview

Provides access to setting keys.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_name = nil) ⇒ Keymaster

Returns a new instance of Keymaster.



27
28
29
# File 'lib/auther/keymaster.rb', line 27

def initialize  = nil
  @account_name = 
end

Instance Attribute Details

#account_nameObject (readonly)

Returns the value of attribute account_name.



6
7
8
# File 'lib/auther/keymaster.rb', line 6

def 
  @account_name
end

Class Method Details

.get_account_login(session = {}) ⇒ Object



22
23
24
25
# File 'lib/auther/keymaster.rb', line 22

def self. session = {}
   =  session
  session[new().]
end

.get_account_name(session = {}) ⇒ Object



16
17
18
19
20
# File 'lib/auther/keymaster.rb', line 16

def self. session = {}
  matching_keys = session.keys.select { |key| key.to_s =~ /auther.+login/ }
  key = matching_keys.first || ""
  key.gsub("#{namespace}_", "").gsub "_login", ""
end

.namespaceObject



8
9
10
# File 'lib/auther/keymaster.rb', line 8

def self.namespace
  "auther"
end

.redirect_url_key(delimiter: "_") ⇒ Object



12
13
14
# File 'lib/auther/keymaster.rb', line 12

def self.redirect_url_key delimiter: "_"
  [namespace, "redirect", "url"] * delimiter
end

Instance Method Details

#login_keyObject



31
32
33
# File 'lib/auther/keymaster.rb', line 31

def 
  build_key "login"
end

#password_keyObject



35
36
37
# File 'lib/auther/keymaster.rb', line 35

def password_key
  build_key "password"
end