Class: Application::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano-db-pull/application.rb

Direct Known Subclasses

Local, Remote

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance) ⇒ Base

Returns a new instance of Base.



5
6
7
# File 'lib/capistrano-db-pull/application.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-pull/application.rb', line 3

def capistrano
  @capistrano
end

#configObject

Returns the value of attribute config.



3
4
5
# File 'lib/capistrano-db-pull/application.rb', line 3

def config
  @config
end

Instance Method Details

#adapterObject



21
22
23
# File 'lib/capistrano-db-pull/application.rb', line 21

def adapter
  @config['adapter'].downcase
end

#databaseObject



25
26
27
# File 'lib/capistrano-db-pull/application.rb', line 25

def database
  @config['database']
end

#mysql?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/capistrano-db-pull/application.rb', line 17

def mysql?
  adapter == 'mysql2' || adapter == 'mysql'
end

#postgresql?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/capistrano-db-pull/application.rb', line 9

def postgresql?
  adapter == 'pg' || adapter == 'postgresql'
end

#sqlite3?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/capistrano-db-pull/application.rb', line 13

def sqlite3?
  adapter == 'sqlite3'
end