Class: YOLOBackup::RotationPlan
- Inherits:
-
Object
- Object
- YOLOBackup::RotationPlan
- Defined in:
- lib/yolo_backup/rotation_plan.rb
Constant Summary collapse
- SCHEDULE_OPTIONS =
%w{ hourly daily weekly monthly yearly }
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options) ⇒ RotationPlan
constructor
A new instance of RotationPlan.
- #minimum_unit ⇒ Object
Constructor Details
#initialize(name, options) ⇒ RotationPlan
Returns a new instance of RotationPlan.
11 12 13 14 15 16 |
# File 'lib/yolo_backup/rotation_plan.rb', line 11 def initialize(name, ) @name = name SCHEDULE_OPTIONS.each do |option| send("#{option}=", [option]) if .key?(option) end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/yolo_backup/rotation_plan.rb', line 9 def name @name end |
Instance Method Details
#minimum_unit ⇒ Object
18 19 20 21 22 |
# File 'lib/yolo_backup/rotation_plan.rb', line 18 def minimum_unit SCHEDULE_OPTIONS.each do |option| return option if send(option).to_i > 0 end end |