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.



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

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



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

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

.get_account_name(session = {}) ⇒ Object



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

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
# File 'lib/auther/keymaster.rb', line 8

def self.namespace = "auther"

.redirect_url_key(delimiter: "_") ⇒ Object



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

def self.redirect_url_key(delimiter: "_") = [namespace, "redirect", "url"] * delimiter

Instance Method Details

#login_keyObject



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

def  = build_key "login"

#password_keyObject



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

def password_key = build_key "password"