Class: Snapshoter::Volume
- Inherits:
-
Object
- Object
- Snapshoter::Volume
- Defined in:
- lib/snapshoter/volume.rb
Constant Summary collapse
- ValidFrequencies =
[:hourly, :daily, :weekly]
Instance Attribute Summary collapse
-
#freeze_mysql ⇒ Object
readonly
Returns the value of attribute freeze_mysql.
-
#freeze_xfs ⇒ Object
readonly
Returns the value of attribute freeze_xfs.
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#keep ⇒ Object
readonly
Returns the value of attribute keep.
-
#mount_point ⇒ Object
readonly
Returns the value of attribute mount_point.
-
#mysql_password ⇒ Object
readonly
Returns the value of attribute mysql_password.
-
#mysql_port ⇒ Object
readonly
Returns the value of attribute mysql_port.
-
#mysql_sock ⇒ Object
readonly
Returns the value of attribute mysql_sock.
-
#mysql_user ⇒ Object
readonly
Returns the value of attribute mysql_user.
Instance Method Summary collapse
-
#initialize(volume_id, options = {}) ⇒ Volume
constructor
A new instance of Volume.
- #to_s ⇒ Object
Constructor Details
#initialize(volume_id, options = {}) ⇒ Volume
Returns a new instance of Volume.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/snapshoter/volume.rb', line 18 def initialize(volume_id, ={}) = .symbolize_keys @id = volume_id @mount_point = .delete(:mount_point) @freeze_xfs = .delete(:freeze_xfs) || false @frequency = .delete(:frequency) || 'daily' @freeze_mysql = .delete(:freeze_mysql) || false @mysql_user = .delete(:mysql_user) || 'root' @mysql_password = .delete(:mysql_password) @mysql_port = .delete(:mysql_port) @mysql_sock = .delete(:mysql_sock) @keep = .delete(:keep) || 7 @frequency = @frequency.to_sym validate!() end |
Instance Attribute Details
#freeze_mysql ⇒ Object (readonly)
Returns the value of attribute freeze_mysql.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def freeze_mysql @freeze_mysql end |
#freeze_xfs ⇒ Object (readonly)
Returns the value of attribute freeze_xfs.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def freeze_xfs @freeze_xfs end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def frequency @frequency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def id @id end |
#keep ⇒ Object (readonly)
Returns the value of attribute keep.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def keep @keep end |
#mount_point ⇒ Object (readonly)
Returns the value of attribute mount_point.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def mount_point @mount_point end |
#mysql_password ⇒ Object (readonly)
Returns the value of attribute mysql_password.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def mysql_password @mysql_password end |
#mysql_port ⇒ Object (readonly)
Returns the value of attribute mysql_port.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def mysql_port @mysql_port end |
#mysql_sock ⇒ Object (readonly)
Returns the value of attribute mysql_sock.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def mysql_sock @mysql_sock end |
#mysql_user ⇒ Object (readonly)
Returns the value of attribute mysql_user.
16 17 18 |
# File 'lib/snapshoter/volume.rb', line 16 def mysql_user @mysql_user end |
Instance Method Details
#to_s ⇒ Object
37 38 39 |
# File 'lib/snapshoter/volume.rb', line 37 def to_s "##{@id}" end |