Module: HashAuth
- Extended by:
- ActiveSupport::Autoload, ActiveSupport::Concern
- Defined in:
- lib/hash-auth.rb,
lib/hash-auth/client.rb,
lib/hash-auth/config.rb,
lib/hash-auth/railtie.rb,
lib/hash-auth/version.rb,
lib/hash-auth/strategies.rb,
lib/hash-auth/controllers.rb,
lib/hash-auth/web_request.rb,
lib/hash-auth/strategies/base.rb,
lib/hash-auth/strategies/default.rb,
lib/hash-auth/controllers/helpers.rb
Defined Under Namespace
Modules: ClassMethods, Controllers, Strategies
Classes: Client, Config, InstallGenerator, MissingConfiguration, Railtie, StrategyGenerator, WebRequest
Constant Summary
collapse
- VERSION =
"0.1.1"
Class Method Summary
collapse
Class Method Details
.clients ⇒ Object
24
25
26
|
# File 'lib/hash-auth/config.rb', line 24
def self.clients
@clients
end
|
.clients=(val) ⇒ Object
20
21
22
|
# File 'lib/hash-auth/config.rb', line 20
def self.clients=(val)
@clients = val
end
|
.configuration ⇒ Object
12
13
14
|
# File 'lib/hash-auth/config.rb', line 12
def self.configuration
@config || (raise MissingConfiguration.new)
end
|
.configuration=(val) ⇒ Object
16
17
18
|
# File 'lib/hash-auth/config.rb', line 16
def self.configuration=(val)
@config = val
end
|
8
9
10
|
# File 'lib/hash-auth/config.rb', line 8
def self.configure(&block)
@config = Config::Builder.new(&block).build
end
|
22
23
24
|
# File 'lib/hash-auth.rb', line 22
def self.configured?
@config.present?
end
|
.find_client(name) ⇒ Object
28
29
30
|
# File 'lib/hash-auth/config.rb', line 28
def self.find_client(name)
@clients.select{|c| c.customer_identifier == name}[0]
end
|
.find_strategy(name) ⇒ Object
40
41
42
43
44
|
# File 'lib/hash-auth/config.rb', line 40
def self.find_strategy(name)
strategy = self.strategies.select{|s| s.identifier == name}[0]
raise "Strategy specified with name = :#{name} does not exist" unless strategy
strategy
end
|