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 13 |
# 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) @timeout = @s3_config.delete(:timeout) 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
27 28 29 |
# File 'lib/mysql_s3_backup/config.rb', line 27 def self.from_yaml_file(file) new YAML.load_file(file) end |
Instance Method Details
#backup ⇒ Object
23 24 25 |
# File 'lib/mysql_s3_backup/config.rb', line 23 def backup MysqlS3Backup::Backup.new(mysql, bucket, @timeout) end |
#mysql ⇒ Object
15 16 17 |
# File 'lib/mysql_s3_backup/config.rb', line 15 def mysql MysqlS3Backup::Mysql.new(@mysql_config) end |