Class: GemChangelogDiff::Configuration
- Inherits:
-
Object
- Object
- GemChangelogDiff::Configuration
- Defined in:
- lib/gem_changelog_diff/configuration.rb
Constant Summary collapse
- VALID_KEYS =
%i[github_token cache_enabled cache_ttl default_format concurrency ignore_gems no_color request_timeout total_timeout].freeze
Instance Attribute Summary collapse
-
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
-
#cache_ttl ⇒ Object
Returns the value of attribute cache_ttl.
-
#concurrency ⇒ Object
Returns the value of attribute concurrency.
-
#default_format ⇒ Object
Returns the value of attribute default_format.
-
#github_token ⇒ Object
Returns the value of attribute github_token.
-
#ignore_gems ⇒ Object
Returns the value of attribute ignore_gems.
-
#no_color ⇒ Object
Returns the value of attribute no_color.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#total_timeout ⇒ Object
Returns the value of attribute total_timeout.
Instance Method Summary collapse
- #apply(hash) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gem_changelog_diff/configuration.rb', line 12 def initialize @cache_enabled = true @cache_ttl = 86_400 @default_format = "text" @concurrency = 4 @ignore_gems = [] @no_color = false @request_timeout = 10 @total_timeout = 120 end |
Instance Attribute Details
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def cache_enabled @cache_enabled end |
#cache_ttl ⇒ Object
Returns the value of attribute cache_ttl.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def cache_ttl @cache_ttl end |
#concurrency ⇒ Object
Returns the value of attribute concurrency.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def concurrency @concurrency end |
#default_format ⇒ Object
Returns the value of attribute default_format.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def default_format @default_format end |
#github_token ⇒ Object
Returns the value of attribute github_token.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def github_token @github_token end |
#ignore_gems ⇒ Object
Returns the value of attribute ignore_gems.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def ignore_gems @ignore_gems end |
#no_color ⇒ Object
Returns the value of attribute no_color.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def no_color @no_color end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def request_timeout @request_timeout end |
#total_timeout ⇒ Object
Returns the value of attribute total_timeout.
5 6 7 |
# File 'lib/gem_changelog_diff/configuration.rb', line 5 def total_timeout @total_timeout end |
Instance Method Details
#apply(hash) ⇒ Object
23 24 25 26 27 |
# File 'lib/gem_changelog_diff/configuration.rb', line 23 def apply(hash) hash.each do |key, value| public_send(:"#{key}=", value) if VALID_KEYS.include?(key) && !value.nil? end end |