Module: Artifactory::Configurable
- Included in:
- Artifactory, Client
- Defined in:
- lib/artifactory/configurable.rb
Overview
Class Method Summary collapse
-
.keys ⇒ Array<Symbol>
The list of configurable keys.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set the configuration for this config, using a block.
-
#reset! ⇒ self
(also: #setup)
Reset all configuration options to their default values.
Class Method Details
.keys ⇒ Array<Symbol>
The list of configurable keys.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/artifactory/configurable.rb', line 29 def keys @keys ||= [ :endpoint, :username, :password, :proxy_address, :proxy_password, :proxy_port, :proxy_username, :ssl_pem_file, :ssl_verify, :user_agent, :read_timeout, ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set the configuration for this config, using a block.
61 62 63 |
# File 'lib/artifactory/configurable.rb', line 61 def configure yield self end |
#reset! ⇒ self Also known as: setup
Reset all configuration options to their default values.
73 74 75 76 77 78 |
# File 'lib/artifactory/configurable.rb', line 73 def reset! Artifactory::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Defaults.[key]) end self end |