Class: Microservice::Settings
- Inherits:
-
Object
- Object
- Microservice::Settings
- Defined in:
- lib/microservice/settings.rb
Class Method Summary collapse
- .all ⇒ Object
- .application_name ⇒ Object
- .email_default_from ⇒ Object
- .host ⇒ Object
- .host_name ⇒ Object
- .omniauth_provider_path(provider) ⇒ Object
- .omniauth_providers ⇒ Object
- .omniauth_providers_keys ⇒ Object
- .protocol ⇒ Object
- .uuid_prefix ⇒ Object
Class Method Details
.all ⇒ Object
6 7 8 |
# File 'lib/microservice/settings.rb', line 6 def all Rails.application.secrets end |
.application_name ⇒ Object
10 11 12 |
# File 'lib/microservice/settings.rb', line 10 def application_name all[:application_name] || 'Microservice Application' end |
.email_default_from ⇒ Object
14 15 16 |
# File 'lib/microservice/settings.rb', line 14 def email_default_from all[:email_default_from] end |
.host ⇒ Object
26 27 28 |
# File 'lib/microservice/settings.rb', line 26 def host "#{protocol}://#{host_name}" end |
.host_name ⇒ Object
18 19 20 |
# File 'lib/microservice/settings.rb', line 18 def host_name all[:host_name] || 'localhost' end |
.omniauth_provider_path(provider) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/microservice/settings.rb', line 42 def omniauth_provider_path(provider) if opts = omniauth_providers[provider] url = "/users/auth/#{provider}" x = [] x << "auth_provider=#{opts[:auth_provider]}" if opts[:auth_provider] x << "auth_url=#{opts[:auth_url]}" if opts[:auth_url] if x.present? url += '?' + x.join('&') end url else '' end end |
.omniauth_providers ⇒ Object
34 35 36 |
# File 'lib/microservice/settings.rb', line 34 def omniauth_providers all[:omniauth_providers] || {} end |
.omniauth_providers_keys ⇒ Object
38 39 40 |
# File 'lib/microservice/settings.rb', line 38 def omniauth_providers_keys omniauth_providers.keys end |
.protocol ⇒ Object
22 23 24 |
# File 'lib/microservice/settings.rb', line 22 def protocol all[:protocol] || 'http' end |
.uuid_prefix ⇒ Object
30 31 32 |
# File 'lib/microservice/settings.rb', line 30 def uuid_prefix all[:uuid_prefix] || 'micro' end |