Class: FeatureToggleService::Config
- Inherits:
-
Object
- Object
- FeatureToggleService::Config
- Defined in:
- lib/feature_toggle_service/config.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#cache_toggles ⇒ Object
readonly
Returns the value of attribute cache_toggles.
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#etcd_client ⇒ Object
readonly
Returns the value of attribute etcd_client.
-
#key_suffix ⇒ Object
readonly
Returns the value of attribute key_suffix.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #cache_toggles? ⇒ Boolean
- #enabled? ⇒ Boolean
-
#initialize(logger: nil, logger_level: nil, key_suffix: 'suffix', enabled: true, app_name:, etcd_client: { port: 4001 }, cache_toggles: false) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(logger: nil, logger_level: nil, key_suffix: 'suffix', enabled: true, app_name:, etcd_client: { port: 4001 }, cache_toggles: false) ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 12 13 |
# File 'lib/feature_toggle_service/config.rb', line 6 def initialize(logger: nil, logger_level: nil, key_suffix: 'suffix', enabled: true, app_name:, etcd_client: { port: 4001 }, cache_toggles: false) @enabled = enabled @app_name = app_name @etcd_client = etcd_client @key_suffix = key_suffix @logger = logger || build_logger(logger_level) @cache_toggles = cache_toggles end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
4 5 6 |
# File 'lib/feature_toggle_service/config.rb', line 4 def app_name @app_name end |
#cache_toggles ⇒ Object (readonly)
Returns the value of attribute cache_toggles.
4 5 6 |
# File 'lib/feature_toggle_service/config.rb', line 4 def cache_toggles @cache_toggles end |
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled.
4 5 6 |
# File 'lib/feature_toggle_service/config.rb', line 4 def enabled @enabled end |
#etcd_client ⇒ Object (readonly)
Returns the value of attribute etcd_client.
4 5 6 |
# File 'lib/feature_toggle_service/config.rb', line 4 def etcd_client @etcd_client end |
#key_suffix ⇒ Object (readonly)
Returns the value of attribute key_suffix.
4 5 6 |
# File 'lib/feature_toggle_service/config.rb', line 4 def key_suffix @key_suffix end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/feature_toggle_service/config.rb', line 4 def logger @logger end |
Instance Method Details
#cache_toggles? ⇒ Boolean
19 20 21 |
# File 'lib/feature_toggle_service/config.rb', line 19 def cache_toggles? !!cache_toggles end |
#enabled? ⇒ Boolean
15 16 17 |
# File 'lib/feature_toggle_service/config.rb', line 15 def enabled? !!enabled end |