Class: RedisCloudAutoUpgrade::Configuration
- Inherits:
-
Struct
- Object
- Struct
- RedisCloudAutoUpgrade::Configuration
- Defined in:
- lib/redis_cloud_auto_upgrade/configuration.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#heroku_api_key ⇒ Object
Returns the value of attribute heroku_api_key.
-
#heroku_app_name ⇒ Object
Returns the value of attribute heroku_app_name.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#on_upgrade ⇒ Object
Returns the value of attribute on_upgrade.
-
#redis_instance ⇒ Object
Returns the value of attribute redis_instance.
-
#treshhold ⇒ Object
Returns the value of attribute treshhold.
Instance Method Summary collapse
- #configure(**values) ⇒ Object
- #errors_human_readable ⇒ Object
- #only(*keys) ⇒ Object
- #valid? ⇒ Boolean
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
12 13 14 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 12 def errors @errors end |
#heroku_api_key ⇒ Object
Returns the value of attribute heroku_api_key
4 5 6 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4 def heroku_api_key @heroku_api_key end |
#heroku_app_name ⇒ Object
Returns the value of attribute heroku_app_name
4 5 6 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4 def heroku_app_name @heroku_app_name end |
#logger ⇒ Object
Returns the value of attribute logger
4 5 6 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4 def logger @logger end |
#on_upgrade ⇒ Object
Returns the value of attribute on_upgrade
4 5 6 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4 def on_upgrade @on_upgrade end |
#redis_instance ⇒ Object
Returns the value of attribute redis_instance
4 5 6 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4 def redis_instance @redis_instance end |
#treshhold ⇒ Object
Returns the value of attribute treshhold
4 5 6 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4 def treshhold @treshhold end |
Instance Method Details
#configure(**values) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 14 def configure(**values) values.each do |key, val| self[key] = val end self end |
#errors_human_readable ⇒ Object
27 28 29 30 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 27 def errors_human_readable return nil if @errors.empty? missing_fields end |
#only(*keys) ⇒ Object
21 22 23 24 25 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 21 def only(*keys) keys.inject({}) do |h, k| h.merge(k => send(k)) end end |
#valid? ⇒ Boolean
32 33 34 35 36 |
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 32 def valid? heroku_api_key.nil? && @errors.push([:missing, :heroku_api_key]) heroku_app_name.nil? && @errors.push([:missing, :heroku_app_name]) @errors.empty? end |