Class: ORMakers::DBCredentials
- Inherits:
-
Object
- Object
- ORMakers::DBCredentials
- Defined in:
- lib/ormakers/db_credentials.rb
Instance Method Summary collapse
-
#initialize(url = ENV['DATABASE_URL']) ⇒ DBCredentials
constructor
A new instance of DBCredentials.
- #to_hash ⇒ Object
Constructor Details
#initialize(url = ENV['DATABASE_URL']) ⇒ DBCredentials
Returns a new instance of DBCredentials.
3 4 5 |
# File 'lib/ormakers/db_credentials.rb', line 3 def initialize(url = ENV['DATABASE_URL']) @url = url[11..-1] end |
Instance Method Details
#to_hash ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ormakers/db_credentials.rb', line 7 def to_hash { host: host, port: port, dbname: dbname, user: user, password: password, sslmode: 'require' } end |