Class: OsmImport::Target::PgBase::Connection
- Inherits:
-
Struct
- Object
- Struct
- OsmImport::Target::PgBase::Connection
- Defined in:
- lib/osm_import/target/pg_base.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #close ⇒ Object
- #exec(q) ⇒ Object
-
#initialize(*args) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(*args) ⇒ Connection
Returns a new instance of Connection.
30 31 32 33 |
# File 'lib/osm_import/target/pg_base.rb', line 30 def initialize(*args) super @conn = PG.connect [:pg] end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options
28 29 30 |
# File 'lib/osm_import/target/pg_base.rb', line 28 def end |
Instance Method Details
#close ⇒ Object
40 41 42 |
# File 'lib/osm_import/target/pg_base.rb', line 40 def close @conn.close end |
#exec(q) ⇒ Object
35 36 37 38 |
# File 'lib/osm_import/target/pg_base.rb', line 35 def exec(q) puts " #{q}" @conn.exec q end |