Class: Atomically::AdapterCheckService

Inherits:
Object
  • Object
show all
Defined in:
lib/atomically/adapter_check_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ AdapterCheckService

Returns a new instance of AdapterCheckService.



3
4
5
# File 'lib/atomically/adapter_check_service.rb', line 3

def initialize(klass)
  @klass = klass
end

Instance Method Details

#mysql?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/atomically/adapter_check_service.rb', line 11

def mysql?
  possible_mysql_klasses.any?{|s| @klass.connection.is_a?(s) }
end

#pg?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/atomically/adapter_check_service.rb', line 7

def pg?
  possible_pg_klasses.any?{|s| @klass.connection.is_a?(s) }
end