Class: Ghaki::Account::Database
- Includes:
- DB_Connect, DB_Driver, DB_Name, DB_Port
- Defined in:
- lib/ghaki/account/database.rb
Constant Summary
Constants included from Password
Password::ASK_PASSWORD_RETRY_MAX
Constants included from Username
Constants included from Hostname
Instance Attribute Summary
Attributes included from DB_Connect
Attributes included from DB_Driver
Attributes included from DB_Port
Attributes included from DB_Name
Attributes included from EMailAddress
Attributes included from Username
Attributes included from Hostname
Class Method Summary collapse
-
.from_opts(opts) ⇒ Object
———————————————————————.
-
.purge_opts(opts) ⇒ Object
———————————————————————.
Instance Method Summary collapse
-
#expand_opts(opts = {}) ⇒ Object
———————————————————————.
-
#to_s ⇒ Object
———————————————————————.
Methods included from DB_Connect
Methods included from SynOpts
Methods included from DB_Driver
Methods included from DB_Port
Methods included from DB_Name
Methods inherited from Base
#ask_all, #collapse_opts, #initialize
Methods included from Password
#ask_password, #fail_password, #failed_passwords?, #opt_password, #password, #passwords, #passwords=, #reset_passwords, #retry_password?, #valid_password?
Methods included from Username
#ask_username, get_env, #valid_username?
Methods included from Hostname
#ask_hostname, get_env, #valid_hostname?
Constructor Details
This class inherits a constructor from Ghaki::Account::Base
Class Method Details
.from_opts(opts) ⇒ Object
21 22 23 |
# File 'lib/ghaki/account/database.rb', line 21 def self.from_opts opts opts[:account] || Database.new(opts) end |
.purge_opts(opts) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/ghaki/account/database.rb', line 26 def self.purge_opts opts ; super opts DB_Name.purge_opts opts DB_Port.purge_opts opts DB_Driver.purge_opts opts DB_Connect.purge_opts opts opts end |
Instance Method Details
#expand_opts(opts = {}) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/ghaki/account/database.rb', line 39 def opts={} ; super opts opts[:db_name] = @db_name unless @db_name.nil? opts[:db_port] = @db_port unless @db_port.nil? opts[:db_driver] = @db_driver unless @db_driver.nil? opts[:db_connect] = @db_connect unless @db_connect.nil? opts end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/ghaki/account/database.rb', line 48 def to_s @db_name + ':' + (@username || '*') + '@' + (@hostname || 'localhost') end |