Class: SA
- Inherits:
-
Object
- Object
- SA
- Includes:
- Singleton
- Defined in:
- lib/active_record/connection_adapters/sqlanywhere_adapter.rb
Overview
Singleton class to hold a valid instance of the SQLAnywhereInterface across all connections
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
-
#initialize ⇒ SA
constructor
A new instance of SA.
Constructor Details
#initialize ⇒ SA
Returns a new instance of SA.
34 35 36 37 38 39 |
# File 'lib/active_record/connection_adapters/sqlanywhere_adapter.rb', line 34 def initialize require 'sqlanywhere' unless defined? SQLAnywhere @api = SQLAnywhere::SQLAnywhereInterface.new() raise LoadError, "Could not load SQLAnywhere DBCAPI library" if SQLAnywhere::API.sqlany_initialize_interface(@api) == 0 raise LoadError, "Could not initialize SQLAnywhere DBCAPI library" if @api.sqlany_init() == 0 end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
32 33 34 |
# File 'lib/active_record/connection_adapters/sqlanywhere_adapter.rb', line 32 def api @api end |