Class: FlareUp::Connection
- Inherits:
-
Object
- Object
- FlareUp::Connection
- Defined in:
- lib/flare_up/connection.rb
Instance Attribute Summary collapse
-
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout.
-
#dbname ⇒ Object
Returns the value of attribute dbname.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #cancel_current_command ⇒ Object
- #execute(statement) ⇒ Object
-
#initialize(host, dbname, user, password) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(host, dbname, user, password) ⇒ Connection
Returns a new instance of Connection.
25 26 27 28 29 30 31 32 33 |
# File 'lib/flare_up/connection.rb', line 25 def initialize(host, dbname, user, password) @host = host @dbname = dbname @user = user @password = password @port = 5439 @connect_timeout = 5 end |
Instance Attribute Details
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout.
23 24 25 |
# File 'lib/flare_up/connection.rb', line 23 def connect_timeout @connect_timeout end |
#dbname ⇒ Object
Returns the value of attribute dbname.
20 21 22 |
# File 'lib/flare_up/connection.rb', line 20 def dbname @dbname end |
#host ⇒ Object
Returns the value of attribute host.
18 19 20 |
# File 'lib/flare_up/connection.rb', line 18 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
22 23 24 |
# File 'lib/flare_up/connection.rb', line 22 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
19 20 21 |
# File 'lib/flare_up/connection.rb', line 19 def port @port end |
#user ⇒ Object
Returns the value of attribute user.
21 22 23 |
# File 'lib/flare_up/connection.rb', line 21 def user @user end |
Instance Method Details
#cancel_current_command ⇒ Object
39 40 41 |
# File 'lib/flare_up/connection.rb', line 39 def cancel_current_command connection.cancel end |
#execute(statement) ⇒ Object
35 36 37 |
# File 'lib/flare_up/connection.rb', line 35 def execute(statement) connection.async_exec(statement) end |