Module: Redshift::Client::ConnectionHandling
- Included in:
- Redshift::Client
- Defined in:
- lib/redshift/client/connection_handling.rb
Instance Method Summary collapse
- #connected? ⇒ Boolean
- #connection ⇒ Object
- #disconnect ⇒ Object
- #establish_connection(config = {}) ⇒ Object
- #established? ⇒ Boolean
Instance Method Details
#connected? ⇒ Boolean
32 33 34 |
# File 'lib/redshift/client/connection_handling.rb', line 32 def connected? !! current[:connection] end |
#connection ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/redshift/client/connection_handling.rb', line 14 def connection return current[:connection] if connected? ActiveSupport.run_load_hooks :redshift_client_connection check_established! current[:connection] = Connection.new(current[:configuration]) current[:connection] end |
#disconnect ⇒ Object
24 25 26 |
# File 'lib/redshift/client/connection_handling.rb', line 24 def disconnect clear_connection! end |
#establish_connection(config = {}) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/redshift/client/connection_handling.rb', line 7 def establish_connection(config= {}) clear_connection! clear_thread! current[:configuration] = Configuration.resolve(config) end |
#established? ⇒ Boolean
28 29 30 |
# File 'lib/redshift/client/connection_handling.rb', line 28 def established? !! current[:configuration] end |