Class: FlareUp::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/flare_up/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_timeoutObject

Returns the value of attribute connect_timeout.



23
24
25
# File 'lib/flare_up/connection.rb', line 23

def connect_timeout
  @connect_timeout
end

#dbnameObject

Returns the value of attribute dbname.



20
21
22
# File 'lib/flare_up/connection.rb', line 20

def dbname
  @dbname
end

#hostObject

Returns the value of attribute host.



18
19
20
# File 'lib/flare_up/connection.rb', line 18

def host
  @host
end

#passwordObject

Returns the value of attribute password.



22
23
24
# File 'lib/flare_up/connection.rb', line 22

def password
  @password
end

#portObject

Returns the value of attribute port.



19
20
21
# File 'lib/flare_up/connection.rb', line 19

def port
  @port
end

#userObject

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_commandObject



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