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].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.
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.
10 11 12 13 14 15 16 17 |
# File 'lib/gem_changelog_diff/configuration.rb', line 10 def initialize @cache_enabled = true @cache_ttl = 86_400 @default_format = "text" @concurrency = 4 @ignore_gems = [] @no_color = false 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 |
Instance Method Details
#apply(hash) ⇒ Object
19 20 21 22 23 |
# File 'lib/gem_changelog_diff/configuration.rb', line 19 def apply(hash) hash.each do |key, value| public_send(:"#{key}=", value) if VALID_KEYS.include?(key) && !value.nil? end end |