Class: DBI::DBD::SQLAnywhere::SA
- Inherits:
-
Object
- Object
- DBI::DBD::SQLAnywhere::SA
- Includes:
- Singleton
- Defined in:
- lib/dbd/SQLAnywhere.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
- #free_api ⇒ Object
-
#initialize ⇒ SA
constructor
A new instance of SA.
Constructor Details
#initialize ⇒ SA
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
#api ⇒ Object
Returns the value of attribute api.
49 50 51 |
# File 'lib/dbd/SQLAnywhere.rb', line 49 def api @api end |
Instance Method Details
#free_api ⇒ Object
67 68 69 70 |
# File 'lib/dbd/SQLAnywhere.rb', line 67 def free_api ::SQLAnywhere::API.sqlany_finalize_interface( @api ); @api = nil end |