Class: RedisCloudAutoUpgrade::Configuration

Inherits:
Struct
  • Object
show all
Defined in:
lib/redis_cloud_auto_upgrade/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorsObject (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_keyObject

Returns the value of attribute heroku_api_key

Returns:

  • (Object)

    the current value of 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_nameObject

Returns the value of attribute heroku_app_name

Returns:

  • (Object)

    the current value of heroku_app_name



4
5
6
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4

def heroku_app_name
  @heroku_app_name
end

#loggerObject

Returns the value of attribute logger

Returns:

  • (Object)

    the current value of logger



4
5
6
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4

def logger
  @logger
end

#on_upgradeObject

Returns the value of attribute on_upgrade

Returns:

  • (Object)

    the current value of on_upgrade



4
5
6
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4

def on_upgrade
  @on_upgrade
end

#redis_instanceObject

Returns the value of attribute redis_instance

Returns:

  • (Object)

    the current value of redis_instance



4
5
6
# File 'lib/redis_cloud_auto_upgrade/configuration.rb', line 4

def redis_instance
  @redis_instance
end

#treshholdObject

Returns the value of attribute treshhold

Returns:

  • (Object)

    the current value of 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_readableObject



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

Returns:

  • (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