Class: MongoBacker::Configuration
- Inherits:
-
Object
- Object
- MongoBacker::Configuration
- Defined in:
- lib/mongo_backer/configuration.rb
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#host ⇒ Object
Returns the value of attribute host.
-
#mongodump ⇒ Object
Returns the value of attribute mongodump.
-
#port ⇒ Object
Returns the value of attribute port.
-
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(*args) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mongo_backer/configuration.rb', line 5 def initialize(*args) unless args.empty? config = YAML.load_file(args[0]) @host = config["mongo"]["host"] @port = config["mongo"]["port"] @mongodump = config["mongo"]["mongodump"] @access_key_id = config["s3"]["access_key_id"] @secret_access_key = config["s3"]["secret_access_key"] @bucket = config["s3"]["bucket"] end rescue Errno::ENOENT raise ArgumentError, "file not found at #{args[0]}" end |
Instance Attribute Details
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
3 4 5 |
# File 'lib/mongo_backer/configuration.rb', line 3 def access_key_id @access_key_id end |
#bucket ⇒ Object
Returns the value of attribute bucket.
3 4 5 |
# File 'lib/mongo_backer/configuration.rb', line 3 def bucket @bucket end |
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/mongo_backer/configuration.rb', line 3 def host @host end |
#mongodump ⇒ Object
Returns the value of attribute mongodump.
3 4 5 |
# File 'lib/mongo_backer/configuration.rb', line 3 def mongodump @mongodump end |
#port ⇒ Object
Returns the value of attribute port.
3 4 5 |
# File 'lib/mongo_backer/configuration.rb', line 3 def port @port end |
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
3 4 5 |
# File 'lib/mongo_backer/configuration.rb', line 3 def secret_access_key @secret_access_key end |