Module: ExvoAuth::Config
- Defined in:
- lib/exvo_auth/config.rb
Class Method Summary collapse
- .callback_key ⇒ Object
- .callback_key=(callback_key) ⇒ Object
- .client_id ⇒ Object
- .client_id=(client_id) ⇒ Object
- .client_secret ⇒ Object
- .client_secret=(client_secret) ⇒ Object
- .debug ⇒ Object
- .debug=(debug) ⇒ Object
- .env ⇒ Object
- .env=(env) ⇒ Object
- .host ⇒ Object
- .host=(host) ⇒ Object
- .require_ssl ⇒ Object
- .require_ssl=(require_ssl) ⇒ Object
- .uri ⇒ Object
Class Method Details
.callback_key ⇒ Object
27 28 29 |
# File 'lib/exvo_auth/config.rb', line 27 def self.callback_key @@callback_key ||= '_callback' end |
.callback_key=(callback_key) ⇒ Object
31 32 33 |
# File 'lib/exvo_auth/config.rb', line 31 def self.callback_key=(callback_key) @@callback_key = callback_key end |
.client_id ⇒ Object
35 36 37 |
# File 'lib/exvo_auth/config.rb', line 35 def self.client_id @@client_id ||= ENV['AUTH_CLIENT_ID'] end |
.client_id=(client_id) ⇒ Object
39 40 41 |
# File 'lib/exvo_auth/config.rb', line 39 def self.client_id=(client_id) @@client_id = client_id end |
.client_secret ⇒ Object
43 44 45 |
# File 'lib/exvo_auth/config.rb', line 43 def self.client_secret @@client_secret ||= ENV['AUTH_CLIENT_SECRET'] end |
.client_secret=(client_secret) ⇒ Object
47 48 49 |
# File 'lib/exvo_auth/config.rb', line 47 def self.client_secret=(client_secret) @@client_secret = client_secret end |
.debug ⇒ Object
2 3 4 |
# File 'lib/exvo_auth/config.rb', line 2 def self.debug @@debug ||= (ENV['AUTH_DEBUG'] == 'true') || false end |
.debug=(debug) ⇒ Object
6 7 8 |
# File 'lib/exvo_auth/config.rb', line 6 def self.debug=(debug) @@debug = debug end |
.env ⇒ Object
59 60 61 62 63 |
# File 'lib/exvo_auth/config.rb', line 59 def self.env @@env ||= Rails.env if defined?(Rails) @@env ||= Merb.env if defined?(Merb) @@env end |
.env=(env) ⇒ Object
65 66 67 |
# File 'lib/exvo_auth/config.rb', line 65 def self.env=(env) @@env = env end |
.host ⇒ Object
10 11 12 |
# File 'lib/exvo_auth/config.rb', line 10 def self.host @@host ||= ENV['AUTH_HOST'] || default_opts[env.to_sym][:host] end |
.host=(host) ⇒ Object
14 15 16 |
# File 'lib/exvo_auth/config.rb', line 14 def self.host=(host) @@host = host end |
.require_ssl ⇒ Object
51 52 53 |
# File 'lib/exvo_auth/config.rb', line 51 def self.require_ssl @@require_ssl ||= (ENV['AUTH_REQUIRE_SSL'] == 'true') || default_opts[env.to_sym][:require_ssl] end |
.require_ssl=(require_ssl) ⇒ Object
55 56 57 |
# File 'lib/exvo_auth/config.rb', line 55 def self.require_ssl=(require_ssl) @@require_ssl = require_ssl end |
.uri ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/exvo_auth/config.rb', line 18 def self.uri if host =~ /^http(s)*/ # Legacy compatibility, when `host` was incorrectly used as `uri` host else require_ssl ? "https://#{host}" : "http://#{host}" end end |