Class: DBI::DBD::SQLAnywhere::SA

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/dbd/SQLAnywhere.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSA

Returns a new instance of SA.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/dbd/SQLAnywhere.rb', line 51

def initialize
	 unless defined? SQLAnywhere
	   require 'sqlanywhere'
	 end

	 @api = ::SQLAnywhere::SQLAnywhereInterface.new()
	 result = ::SQLAnywhere::API.sqlany_initialize_interface( @api )
	 if result == 0 
raise LoadError, "Could not load SQLAnywhere DLL"
	 end
	 result = @api.sqlany_init()
	 if result == 0 
raise LoadError, "Could not initialize SQLAnywhere DLL"
	 end
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



49
50
51
# File 'lib/dbd/SQLAnywhere.rb', line 49

def api
  @api
end

Instance Method Details

#free_apiObject



67
68
69
70
# File 'lib/dbd/SQLAnywhere.rb', line 67

def free_api
	 ::SQLAnywhere::API.sqlany_finalize_interface( @api );
	 @api = nil
end