Class: WCC::Auth::Config
- Inherits:
-
Struct
- Object
- Struct
- WCC::Auth::Config
- Defined in:
- lib/wcc/auth/config.rb
Instance Attribute Summary collapse
-
#app_domain_suffix ⇒ Object
Returns the value of attribute app_domain_suffix.
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#app_secret ⇒ Object
Returns the value of attribute app_secret.
-
#app_url ⇒ Object
Returns the value of attribute app_url.
-
#app_url_protocol ⇒ Object
Returns the value of attribute app_url_protocol.
-
#authorize_params ⇒ Object
Returns the value of attribute authorize_params.
-
#authorize_path ⇒ Object
Returns the value of attribute authorize_path.
-
#authorize_site ⇒ Object
Returns the value of attribute authorize_site.
-
#environment ⇒ Object
Returns the value of attribute environment.
Instance Method Summary collapse
- #app_domain_suffix_for(environment) ⇒ Object
- #app_url_protocol_for(environment) ⇒ Object
- #nucleus_url ⇒ Object
- #url_for(app_name) ⇒ Object
Instance Attribute Details
#app_domain_suffix ⇒ Object
Returns the value of attribute app_domain_suffix
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def app_domain_suffix @app_domain_suffix end |
#app_id ⇒ Object
Returns the value of attribute app_id
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def app_id @app_id end |
#app_name ⇒ Object
Returns the value of attribute app_name
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def app_name @app_name end |
#app_secret ⇒ Object
Returns the value of attribute app_secret
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def app_secret @app_secret end |
#app_url ⇒ Object
Returns the value of attribute app_url
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def app_url @app_url end |
#app_url_protocol ⇒ Object
Returns the value of attribute app_url_protocol
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def app_url_protocol @app_url_protocol end |
#authorize_params ⇒ Object
Returns the value of attribute authorize_params
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def @authorize_params end |
#authorize_path ⇒ Object
Returns the value of attribute authorize_path
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def @authorize_path end |
#authorize_site ⇒ Object
Returns the value of attribute authorize_site
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def @authorize_site end |
#environment ⇒ Object
Returns the value of attribute environment
1 2 3 |
# File 'lib/wcc/auth/config.rb', line 1 def environment @environment end |
Instance Method Details
#app_domain_suffix_for(environment) ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/wcc/auth/config.rb', line 55 def app_domain_suffix_for(environment) case environment.to_sym when :production ".watermark.org" when :staging ".staging.watermark.org" when :development ".dev" end end |
#app_url_protocol_for(environment) ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/wcc/auth/config.rb', line 66 def app_url_protocol_for(environment) case environment.to_sym when :production "https" else "http" end end |
#nucleus_url ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/wcc/auth/config.rb', line 42 def nucleus_url return ENV['NUCLEUS_URL'] if ENV['NUCLEUS_URL'] case environment.to_sym when :production "https://login.watermark.org" when :staging "http://login.staging.watermark.org" when :development "http://login.dev" end end |
#url_for(app_name) ⇒ Object
36 37 38 39 40 |
# File 'lib/wcc/auth/config.rb', line 36 def url_for(app_name) return ENV["#{app_name.to_s.upcase}_URL"] if ENV["#{app_name.to_s.upcase}_URL"] "#{app_url_protocol_for(environment)}://#{app_name}#{app_domain_suffix_for(environment)}" end |