Class: StompBase::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/stomp_base/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_productionObject

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_enabledObject

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_methodObject

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_localesObject

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_passwordObject

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_usernameObject

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_authenticatorObject

Returns the value of attribute custom_authenticator.



5
6
7
# File 'lib/stomp_base/configuration.rb', line 5

def custom_authenticator
  @custom_authenticator
end

#localeObject

Returns the value of attribute locale.



11
12
13
# File 'lib/stomp_base/configuration.rb', line 11

def locale
  @locale
end

#valid_api_keysObject

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

Returns:

  • (Boolean)


34
35
36
# File 'lib/stomp_base/configuration.rb', line 34

def authentication_enabled?
  @authentication_enabled
end

#disable_authenticationObject



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, **options)
  @authentication_enabled = true
  @authentication_method = method
  configure_authentication_method(method, options)
end