Module: RBHive

Defined in:
lib/rbhive/connection.rb

Defined Under Namespace

Classes: Connection, ResultSet, StdOutLogger

Class Method Summary collapse

Class Method Details

.connect(server, port = 10_000) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rbhive/connection.rb', line 4

def connect(server, port=10_000)
  connection = RBHive::Connection.new(server, port)
  ret = nil
  begin
    connection.open
    ret = yield(connection)
  ensure
    connection.close
    ret
  end
end