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.
13 14 15 16 17 18 19 20 21 |
# File 'lib/artifactory/configurable.rb', line 13 def keys @keys ||= [ :endpoint, :username, :password, :proxy, :user_agent, ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set the configuration for this config, using a block.
39 40 41 |
# File 'lib/artifactory/configurable.rb', line 39 def configure yield self end |
#reset! ⇒ self Also known as: setup
Reset all configuration options to their default values.
51 52 53 54 55 56 |
# File 'lib/artifactory/configurable.rb', line 51 def reset! Artifactory::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Defaults.[key]) end self end |