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.



44
45
46
47
48
49
50
# File 'lib/discharger/setup_runner/configuration.rb', line 44

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.



42
43
44
# File 'lib/discharger/setup_runner/configuration.rb', line 42

def name
  @name
end

#passwordObject

Returns the value of attribute password.



42
43
44
# File 'lib/discharger/setup_runner/configuration.rb', line 42

def password
  @password
end

#portObject

Returns the value of attribute port.



42
43
44
# File 'lib/discharger/setup_runner/configuration.rb', line 42

def port
  @port
end

#prefer_dockerObject

Returns the value of attribute prefer_docker.



42
43
44
# File 'lib/discharger/setup_runner/configuration.rb', line 42

def prefer_docker
  @prefer_docker
end

#versionObject

Returns the value of attribute version.



42
43
44
# File 'lib/discharger/setup_runner/configuration.rb', line 42

def version
  @version
end

Instance Method Details

#from_hash(hash) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/discharger/setup_runner/configuration.rb', line 52

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