Module: RobustClientSocket::Configuration
- Included in:
- RobustClientSocket
- Defined in:
- lib/robust_client_socket/configuration.rb
Constant Summary collapse
- MIN_KEY_SIZE =
2048
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#configured ⇒ Object
readonly
Returns the value of attribute configured.
Instance Method Summary collapse
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/robust_client_socket/configuration.rb', line 5 def configuration @configuration end |
#configured ⇒ Object (readonly)
Returns the value of attribute configured.
5 6 7 |
# File 'lib/robust_client_socket/configuration.rb', line 5 def configured @configured end |
Instance Method Details
#configure {|configuration| ... } ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/robust_client_socket/configuration.rb', line 7 def configure @configuration ||= ConfigStore.new yield(configuration) validate_keys_security! @configured = true end |
#configured? ⇒ Boolean
25 26 27 |
# File 'lib/robust_client_socket/configuration.rb', line 25 def configured? !!@configured && correct_configuration? end |
#correct_configuration? ⇒ Boolean
15 16 17 18 19 20 21 22 23 |
# File 'lib/robust_client_socket/configuration.rb', line 15 def correct_configuration? return false unless configuration.services.is_a?(Hash) return false if configuration.services.empty? return false if configuration.client_name.nil? configuration.services.all? do |_, creds| creds.key?(:base_uri) && creds.key?(:public_key) end end |