Class: Database::Base
- Inherits:
-
Object
- Object
- Database::Base
- Defined in:
- lib/capistrano/db/database.rb
Instance Attribute Summary collapse
-
#capistrano ⇒ Object
Returns the value of attribute capistrano.
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #adapter ⇒ Object
-
#initialize(instance) ⇒ Base
constructor
A new instance of Base.
- #postgresql? ⇒ Boolean
- #sqlite3? ⇒ Boolean
Constructor Details
#initialize(instance) ⇒ Base
5 6 7 |
# File 'lib/capistrano/db/database.rb', line 5 def initialize(instance) @capistrano = instance end |
Instance Attribute Details
#capistrano ⇒ Object
Returns the value of attribute capistrano.
3 4 5 |
# File 'lib/capistrano/db/database.rb', line 3 def capistrano @capistrano end |
#config ⇒ Object
Returns the value of attribute config.
3 4 5 |
# File 'lib/capistrano/db/database.rb', line 3 def config @config end |
Instance Method Details
#adapter ⇒ Object
17 18 19 |
# File 'lib/capistrano/db/database.rb', line 17 def adapter @config['adapter'].downcase end |
#postgresql? ⇒ Boolean
9 10 11 |
# File 'lib/capistrano/db/database.rb', line 9 def postgresql? adapter == 'pg' || adapter == 'postgresql' end |
#sqlite3? ⇒ Boolean
13 14 15 |
# File 'lib/capistrano/db/database.rb', line 13 def sqlite3? adapter == 'sqlite3' end |