Class: Kiba::Plus::Destination::Mysql
- Inherits:
-
Object
- Object
- Kiba::Plus::Destination::Mysql
- Includes:
- Helper
- Defined in:
- lib/kiba/plus/destination/mysql.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}) ⇒ Mysql
constructor
A new instance of Mysql.
- #write(row) ⇒ Object
Methods included from Helper
#format_sql, #mysql2_connect_hash, #scheme
Constructor Details
#initialize(options = {}) ⇒ Mysql
Returns a new instance of Mysql.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kiba/plus/destination/mysql.rb', line 12 def initialize( = {}) @options = @options.assert_valid_keys( :connect_url, :prepare_sql, :columns ) @client = Mysql2::Client.new(mysql2_connect_hash(connect_url)) init end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/kiba/plus/destination/mysql.rb', line 10 def client @client end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/kiba/plus/destination/mysql.rb', line 10 def @options end |
Instance Method Details
#close ⇒ Object
31 32 33 34 |
# File 'lib/kiba/plus/destination/mysql.rb', line 31 def close @client.close @client = nil end |