Class: OpenGeoDb::Database
- Inherits:
-
Object
- Object
- OpenGeoDb::Database
- Defined in:
- lib/open_geo_db/database.rb
Defined Under Namespace
Classes: UnknownActionError
Instance Method Summary collapse
- #execute(action) ⇒ Object
-
#initialize(config) ⇒ Database
constructor
A new instance of Database.
Constructor Details
#initialize(config) ⇒ Database
Returns a new instance of Database.
6 7 8 9 10 |
# File 'lib/open_geo_db/database.rb', line 6 def initialize(config) @database = config["database"] @username = config["username"] @password = "-p#{config["password"]}" if config["password"] end |
Instance Method Details
#execute(action) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/open_geo_db/database.rb', line 12 def execute(action) case action when :create then create when :destroy then destroy else raise UnknownActionError, action end end |