Class: DB2Query::ODBCConnector
- Inherits:
-
Object
- Object
- DB2Query::ODBCConnector
- Defined in:
- lib/db2_query/odbc_connector.rb
Instance Attribute Summary collapse
-
#conn_config ⇒ Object
readonly
Returns the value of attribute conn_config.
-
#conn_type ⇒ Object
readonly
Returns the value of attribute conn_type.
-
#connector ⇒ Object
readonly
Returns the value of attribute connector.
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(type, config) ⇒ ODBCConnector
constructor
A new instance of ODBCConnector.
Constructor Details
#initialize(type, config) ⇒ ODBCConnector
Returns a new instance of ODBCConnector.
9 10 11 12 |
# File 'lib/db2_query/odbc_connector.rb', line 9 def initialize(type, config) @conn_type, @conn_config = type, config.transform_keys(&:to_sym) @connector = DB2Query.const_get("#{conn_type.to_s.camelize}Connector").new end |
Instance Attribute Details
#conn_config ⇒ Object (readonly)
Returns the value of attribute conn_config.
7 8 9 |
# File 'lib/db2_query/odbc_connector.rb', line 7 def conn_config @conn_config end |
#conn_type ⇒ Object (readonly)
Returns the value of attribute conn_type.
7 8 9 |
# File 'lib/db2_query/odbc_connector.rb', line 7 def conn_type @conn_type end |
#connector ⇒ Object (readonly)
Returns the value of attribute connector.
7 8 9 |
# File 'lib/db2_query/odbc_connector.rb', line 7 def connector @connector end |
Instance Method Details
#connect ⇒ Object
14 15 16 |
# File 'lib/db2_query/odbc_connector.rb', line 14 def connect connector.connect(conn_config) end |