Class: Itiel::DB::Connection
- Inherits:
-
Object
- Object
- Itiel::DB::Connection
- Includes:
- Nameable
- Defined in:
- lib/itiel/db/connection.rb
Instance Attribute Summary collapse
-
#connection_name ⇒ Object
Returns the value of attribute connection_name.
-
#sources_file ⇒ Object
Returns the value of attribute sources_file.
Attributes included from Nameable
Instance Method Summary collapse
- #connection_string(refresh = false) ⇒ Object
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize ⇒ Connection
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_name ⇒ Object
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_file ⇒ Object
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 |