Class: MysqlS3Backup::Config
- Inherits:
-
Object
- Object
- MysqlS3Backup::Config
- Defined in:
- lib/mysql_s3_backup/config.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#mysql_config ⇒ Object
readonly
Returns the value of attribute mysql_config.
-
#s3_config ⇒ Object
readonly
Returns the value of attribute s3_config.
Class Method Summary collapse
Instance Method Summary collapse
- #backup ⇒ Object
-
#initialize(config) ⇒ Config
constructor
A new instance of Config.
- #mysql ⇒ Object
Constructor Details
#initialize(config) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 |
# File 'lib/mysql_s3_backup/config.rb', line 7 def initialize(config) config = config.symbolize_keys @mysql_config = config[:mysql].symbolize_keys @s3_config = config[:s3].symbolize_keys @bucket = @s3_config.delete(:bucket) end |
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
5 6 7 |
# File 'lib/mysql_s3_backup/config.rb', line 5 def bucket @bucket end |
#mysql_config ⇒ Object (readonly)
Returns the value of attribute mysql_config.
5 6 7 |
# File 'lib/mysql_s3_backup/config.rb', line 5 def mysql_config @mysql_config end |
#s3_config ⇒ Object (readonly)
Returns the value of attribute s3_config.
5 6 7 |
# File 'lib/mysql_s3_backup/config.rb', line 5 def s3_config @s3_config end |
Class Method Details
.from_yaml_file(file) ⇒ Object
26 27 28 |
# File 'lib/mysql_s3_backup/config.rb', line 26 def self.from_yaml_file(file) new YAML.load_file(file) end |
Instance Method Details
#backup ⇒ Object
22 23 24 |
# File 'lib/mysql_s3_backup/config.rb', line 22 def backup MysqlS3Backup::Backup.new(mysql, bucket) end |
#mysql ⇒ Object
14 15 16 |
# File 'lib/mysql_s3_backup/config.rb', line 14 def mysql MysqlS3Backup::Mysql.new(@mysql_config) end |