Class: Postmodern::DB::Adapter
- Inherits:
-
Object
- Object
- Postmodern::DB::Adapter
- Defined in:
- lib/postmodern/db/adapter.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #execute(sql) ⇒ Object
-
#initialize(config) ⇒ Adapter
constructor
A new instance of Adapter.
- #pg_adapter ⇒ Object
Constructor Details
#initialize(config) ⇒ Adapter
Returns a new instance of Adapter.
9 10 11 |
# File 'lib/postmodern/db/adapter.rb', line 9 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/postmodern/db/adapter.rb', line 7 def config @config end |
Instance Method Details
#execute(sql) ⇒ Object
17 18 19 |
# File 'lib/postmodern/db/adapter.rb', line 17 def execute(sql) pg_adapter.exec(sql) end |
#pg_adapter ⇒ Object
13 14 15 |
# File 'lib/postmodern/db/adapter.rb', line 13 def pg_adapter @pg_adapter ||= PG.connect(db_configuration) end |