Class: Backup::Tasks::MySQL::Credentials
- Inherits:
-
Object
- Object
- Backup::Tasks::MySQL::Credentials
- Defined in:
- lib/backup-agent/tasks/mysql.rb
Instance Method Summary collapse
-
#initialize(user:, password:) ⇒ Credentials
constructor
A new instance of Credentials.
- #stringify ⇒ Object
- #stringify_password ⇒ Object
- #to_options ⇒ Object
Constructor Details
#initialize(user:, password:) ⇒ Credentials
Returns a new instance of Credentials.
66 67 68 69 |
# File 'lib/backup-agent/tasks/mysql.rb', line 66 def initialize(user:, password:) @user = user @password = password end |
Instance Method Details
#stringify ⇒ Object
71 72 73 |
# File 'lib/backup-agent/tasks/mysql.rb', line 71 def stringify "--user #{@user} #{stringify_password}" end |
#stringify_password ⇒ Object
75 76 77 |
# File 'lib/backup-agent/tasks/mysql.rb', line 75 def stringify_password @password.nil? || @password.empty? ? "" : "--password=#{@password}" end |
#to_options ⇒ Object
79 80 81 |
# File 'lib/backup-agent/tasks/mysql.rb', line 79 def ["--user", @user, stringify_password] end |