Class: StompBase::Configuration
- Inherits:
-
Object
- Object
- StompBase::Configuration
- Defined in:
- lib/stomp_base/configuration.rb
Instance Attribute Summary collapse
-
#allow_console_in_production ⇒ Object
Returns the value of attribute allow_console_in_production.
-
#authentication_enabled ⇒ Object
Returns the value of attribute authentication_enabled.
-
#authentication_method ⇒ Object
Returns the value of attribute authentication_method.
-
#available_locales ⇒ Object
Returns the value of attribute available_locales.
-
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
-
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
-
#custom_authenticator ⇒ Object
Returns the value of attribute custom_authenticator.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#valid_api_keys ⇒ Object
Returns the value of attribute valid_api_keys.
Instance Method Summary collapse
- #authentication_enabled? ⇒ Boolean
- #disable_authentication ⇒ Object
- #enable_authentication(method: :basic_auth, **options) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/stomp_base/configuration.rb', line 13 def initialize @locale = :en @available_locales = i[en ja] @authentication_enabled = false @authentication_method = :basic_auth @basic_auth_username = nil @basic_auth_password = nil @valid_api_keys = [] @custom_authenticator = nil @allow_console_in_production = false # Whether to allow console functionality in production environment end |
Instance Attribute Details
#allow_console_in_production ⇒ Object
Returns the value of attribute allow_console_in_production.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def allow_console_in_production @allow_console_in_production end |
#authentication_enabled ⇒ Object
Returns the value of attribute authentication_enabled.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def authentication_enabled @authentication_enabled end |
#authentication_method ⇒ Object
Returns the value of attribute authentication_method.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def authentication_method @authentication_method end |
#available_locales ⇒ Object
Returns the value of attribute available_locales.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def available_locales @available_locales end |
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def basic_auth_password @basic_auth_password end |
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def basic_auth_username @basic_auth_username end |
#custom_authenticator ⇒ Object
Returns the value of attribute custom_authenticator.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def custom_authenticator @custom_authenticator end |
#locale ⇒ Object
Returns the value of attribute locale.
11 12 13 |
# File 'lib/stomp_base/configuration.rb', line 11 def locale @locale end |
#valid_api_keys ⇒ Object
Returns the value of attribute valid_api_keys.
5 6 7 |
# File 'lib/stomp_base/configuration.rb', line 5 def valid_api_keys @valid_api_keys end |
Instance Method Details
#authentication_enabled? ⇒ Boolean
34 35 36 |
# File 'lib/stomp_base/configuration.rb', line 34 def authentication_enabled? @authentication_enabled end |
#disable_authentication ⇒ Object
44 45 46 |
# File 'lib/stomp_base/configuration.rb', line 44 def disable_authentication @authentication_enabled = false end |
#enable_authentication(method: :basic_auth, **options) ⇒ Object
38 39 40 41 42 |
# File 'lib/stomp_base/configuration.rb', line 38 def enable_authentication(method: :basic_auth, **) @authentication_enabled = true @authentication_method = method configure_authentication_method(method, ) end |