Class: Pgtk::Wire::Direct
- Inherits:
-
Object
- Object
- Pgtk::Wire::Direct
- Defined in:
- lib/pgtk/wire.rb
Overview
Simple wire with details.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2019-2024 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
-
#connection ⇒ Object
Create a new connection to PostgreSQL server.
-
#initialize(host:, port:, dbname:, user:, password:) ⇒ Direct
constructor
Constructor.
Constructor Details
#initialize(host:, port:, dbname:, user:, password:) ⇒ Direct
Constructor.
41 42 43 44 45 46 47 48 49 |
# File 'lib/pgtk/wire.rb', line 41 def initialize(host:, port:, dbname:, user:, password:) raise "The host can't be nil" if host.nil? @host = host raise "The host can't be nil" if host.nil? @port = port @dbname = dbname @user = user @password = password end |
Instance Method Details
#connection ⇒ Object
Create a new connection to PostgreSQL server.
52 53 54 55 56 57 |
# File 'lib/pgtk/wire.rb', line 52 def connection PG.connect( dbname: @dbname, host: @host, port: @port, user: @user, password: @password ) end |