Class: Database::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/db/database.rb

Direct Known Subclasses

Local, Remote

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#capistranoObject

Returns the value of attribute capistrano.



3
4
5
# File 'lib/capistrano/db/database.rb', line 3

def capistrano
  @capistrano
end

#configObject

Returns the value of attribute config.



3
4
5
# File 'lib/capistrano/db/database.rb', line 3

def config
  @config
end

Instance Method Details

#adapterObject



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