Class: SacsRuby::Configuration
- Inherits:
-
Object
- Object
- SacsRuby::Configuration
- Defined in:
- lib/sacs_ruby/configuration.rb
Overview
Class for holding configuration
Instance Attribute Summary collapse
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#group ⇒ Object
Returns the value of attribute group.
-
#token_strategy ⇒ Object
Returns the value of attribute token_strategy.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
- #attributes=(attrs = {}) ⇒ Object
- #auth_base_url ⇒ Object
-
#initialize(attrs = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #shared_token? ⇒ Boolean
Constructor Details
#initialize(attrs = {}) ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 |
# File 'lib/sacs_ruby/configuration.rb', line 7 def initialize(attrs = {}) self.attributes = attrs end |
Instance Attribute Details
#client_secret ⇒ Object
Returns the value of attribute client_secret.
4 5 6 |
# File 'lib/sacs_ruby/configuration.rb', line 4 def client_secret @client_secret end |
#domain ⇒ Object
Returns the value of attribute domain.
4 5 6 |
# File 'lib/sacs_ruby/configuration.rb', line 4 def domain @domain end |
#environment ⇒ Object
Returns the value of attribute environment.
4 5 6 |
# File 'lib/sacs_ruby/configuration.rb', line 4 def environment @environment end |
#group ⇒ Object
Returns the value of attribute group.
4 5 6 |
# File 'lib/sacs_ruby/configuration.rb', line 4 def group @group end |
#token_strategy ⇒ Object
Returns the value of attribute token_strategy.
4 5 6 |
# File 'lib/sacs_ruby/configuration.rb', line 4 def token_strategy @token_strategy end |
#user_id ⇒ Object
Returns the value of attribute user_id.
4 5 6 |
# File 'lib/sacs_ruby/configuration.rb', line 4 def user_id @user_id end |
Instance Method Details
#attributes=(attrs = {}) ⇒ Object
11 12 13 |
# File 'lib/sacs_ruby/configuration.rb', line 11 def attributes=(attrs = {}) attrs.each { |key, value| instance_variable_set("@#{key}", value) } end |
#auth_base_url ⇒ Object
15 16 17 |
# File 'lib/sacs_ruby/configuration.rb', line 15 def auth_base_url "#{environment}/v2/auth/token" end |
#shared_token? ⇒ Boolean
19 20 21 |
# File 'lib/sacs_ruby/configuration.rb', line 19 def shared_token? token_strategy == :shared end |