Class: ActiveRecord::ConnectionAdapters::ConnectionSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/connection_adapters/connection_specification.rb

Overview

:nodoc:

Defined Under Namespace

Classes: ConnectionUrlResolver, Resolver

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, config, adapter_method) ⇒ ConnectionSpecification

Returns a new instance of ConnectionSpecification.



10
11
12
# File 'lib/active_record/connection_adapters/connection_specification.rb', line 10

def initialize(name, config, adapter_method)
  @name, @config, @adapter_method = name, config, adapter_method
end

Instance Attribute Details

#adapter_methodObject (readonly)

Returns the value of attribute adapter_method.



8
9
10
# File 'lib/active_record/connection_adapters/connection_specification.rb', line 8

def adapter_method
  @adapter_method
end

#configObject (readonly)

Returns the value of attribute config.



8
9
10
# File 'lib/active_record/connection_adapters/connection_specification.rb', line 8

def config
  @config
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/active_record/connection_adapters/connection_specification.rb', line 8

def name
  @name
end

Instance Method Details

#initialize_dup(original) ⇒ Object



14
15
16
# File 'lib/active_record/connection_adapters/connection_specification.rb', line 14

def initialize_dup(original)
  @config = original.config.dup
end

#to_hashObject



18
19
20
# File 'lib/active_record/connection_adapters/connection_specification.rb', line 18

def to_hash
  @config.merge(name: @name)
end