Class: Itiel::DB::Connection

Inherits:
Object
  • Object
show all
Includes:
Nameable
Defined in:
lib/itiel/db/connection.rb

Instance Attribute Summary collapse

Attributes included from Nameable

#debug, #step_name

Instance Method Summary collapse

Constructor Details

#initializeConnection

Returns a new instance of Connection.



9
10
11
# File 'lib/itiel/db/connection.rb', line 9

def initialize
  self.sources_file = 'config/sources.yml'
end

Instance Attribute Details

#connection_nameObject

Returns the value of attribute connection_name.



7
8
9
# File 'lib/itiel/db/connection.rb', line 7

def connection_name
  @connection_name
end

#sources_fileObject

Returns the value of attribute sources_file.



6
7
8
# File 'lib/itiel/db/connection.rb', line 6

def sources_file
  @sources_file
end

Instance Method Details

#connection_string(refresh = false) ⇒ Object



13
14
15
# File 'lib/itiel/db/connection.rb', line 13

def connection_string(refresh = false)
  @connection = ( refresh ? load_from_file : @connection ||= load_from_file)
end