Class: TinyTdsWrapper::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/tiny_tds_wrapper/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



5
6
7
8
# File 'lib/tiny_tds_wrapper/client.rb', line 5

def initialize(config)
  @config = config
  @client = nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object (private)



12
13
14
15
16
17
18
19
20
# File 'lib/tiny_tds_wrapper/client.rb', line 12

def method_missing(method_name, *args, &block)
  connect!
  begin
    @client.send(method_name, *args, &block)
  rescue TinyTds::Error => e
    disconnect!
    raise e
  end
end