Module: Rubypit::Config::Database
- Defined in:
- lib/rubypit/config/database.rb
Class Attribute Summary collapse
-
.connection ⇒ Object
Returns the value of attribute connection.
Class Method Summary collapse
Class Attribute Details
.connection ⇒ Object
Returns the value of attribute connection.
9 10 11 |
# File 'lib/rubypit/config/database.rb', line 9 def connection @connection end |
Class Method Details
.connect! ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/rubypit/config/database.rb', line 11 def connect! return connection if connected? config = load_configuration self.connection = Sequel.connect(config) setup_connection_pool connection end |
.connected? ⇒ Boolean
20 21 22 |
# File 'lib/rubypit/config/database.rb', line 20 def connected? !connection.nil? && !connection.pool.disconnected? end |