Class: Discharger::SetupRunner::DatabaseConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/discharger/setup_runner/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDatabaseConfig

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

#nameObject

Returns the value of attribute name.



40
41
42
# File 'lib/discharger/setup_runner/configuration.rb', line 40

def name
  @name
end

#passwordObject

Returns the value of attribute password.



40
41
42
# File 'lib/discharger/setup_runner/configuration.rb', line 40

def password
  @password
end

#portObject

Returns the value of attribute port.



40
41
42
# File 'lib/discharger/setup_runner/configuration.rb', line 40

def port
  @port
end

#prefer_dockerObject

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

#versionObject

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