Class: Aliyun::Oss::Rule::LifeCycle
- Inherits:
-
Object
- Object
- Aliyun::Oss::Rule::LifeCycle
- Defined in:
- lib/aliyun/oss/rule/lifecycle.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
- Time
-
Set auto auto delete object at given time, at least exist one with days.
-
#days ⇒ Object
- Integer
-
Set auto delete objects after days since last modified, at least exist one with date.
-
#enable ⇒ Object
- Boolean
-
Used for set rule status.
-
#id ⇒ Object
- Integer
-
optional, Rule ID, auto set when not set.
-
#prefix ⇒ Object
- String
-
Used for filter objects.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ LifeCycle
constructor
A new instance of LifeCycle.
- #to_hash ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ LifeCycle
Returns a new instance of LifeCycle.
20 21 22 23 24 25 26 |
# File 'lib/aliyun/oss/rule/lifecycle.rb', line 20 def initialize( = {}) @id = [:id] @prefix = [:prefix] @enable = [:enable] @days = [:days] @date = [:date] end |
Instance Attribute Details
#date ⇒ Object
- Time
-
Set auto auto delete object at given time, at least exist one with days
18 19 20 |
# File 'lib/aliyun/oss/rule/lifecycle.rb', line 18 def date @date end |
#days ⇒ Object
- Integer
-
Set auto delete objects after days since last modified, at least exist one with date
15 16 17 |
# File 'lib/aliyun/oss/rule/lifecycle.rb', line 15 def days @days end |
#enable ⇒ Object
- Boolean
-
Used for set rule status
12 13 14 |
# File 'lib/aliyun/oss/rule/lifecycle.rb', line 12 def enable @enable end |
#id ⇒ Object
- Integer
-
optional, Rule ID, auto set when not set
6 7 8 |
# File 'lib/aliyun/oss/rule/lifecycle.rb', line 6 def id @id end |
#prefix ⇒ Object
- String
-
Used for filter objects
9 10 11 |
# File 'lib/aliyun/oss/rule/lifecycle.rb', line 9 def prefix @prefix end |
Instance Method Details
#to_hash ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/aliyun/oss/rule/lifecycle.rb', line 28 def to_hash if valid? { 'ID' => id || '', 'Prefix' => prefix, 'Status' => status, 'Expiration' => expiration } else {} end end |