Class: Discharger::SetupRunner::DatabaseConfig
- Inherits:
-
Object
- Object
- Discharger::SetupRunner::DatabaseConfig
- Defined in:
- lib/discharger/setup_runner/configuration.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#prefer_docker ⇒ Object
Returns the value of attribute prefer_docker.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #from_hash(hash) ⇒ Object
-
#initialize ⇒ DatabaseConfig
constructor
A new instance of DatabaseConfig.
Constructor Details
#initialize ⇒ DatabaseConfig
Returns a new instance of DatabaseConfig.
42 43 44 45 46 47 48 |
# File 'lib/discharger/setup_runner/configuration.rb', line 42 def initialize @port = 5432 @name = "db-app" @version = "14" @password = "postgres" @prefer_docker = nil end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
40 41 42 |
# File 'lib/discharger/setup_runner/configuration.rb', line 40 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
40 41 42 |
# File 'lib/discharger/setup_runner/configuration.rb', line 40 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
40 41 42 |
# File 'lib/discharger/setup_runner/configuration.rb', line 40 def port @port end |
#prefer_docker ⇒ Object
Returns the value of attribute prefer_docker.
40 41 42 |
# File 'lib/discharger/setup_runner/configuration.rb', line 40 def prefer_docker @prefer_docker end |
#version ⇒ Object
Returns the value of attribute version.
40 41 42 |
# File 'lib/discharger/setup_runner/configuration.rb', line 40 def version @version end |
Instance Method Details
#from_hash(hash) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/discharger/setup_runner/configuration.rb', line 50 def from_hash(hash) @port = hash["port"] if hash["port"] @name = hash["name"] if hash["name"] @version = hash["version"] if hash["version"] @password = hash["password"] if hash["password"] @prefer_docker = hash["prefer_docker"] if hash.key?("prefer_docker") end |