Class: AWS::S3::BucketLifecycleConfiguration::Rule
- Inherits:
-
Object
- Object
- AWS::S3::BucketLifecycleConfiguration::Rule
- Defined in:
- lib/aws/s3/bucket_lifecycle_configuration.rb
Overview
Represents a single rule from an Amazon S3 bucket lifecycle configuration.
# delete all objects with the prefix 'temporary/' after 10 days
bucket.lifecycle_configuration.add_rule 'temporary/', 10
# remove the rule created above
bucket.lifecycle_configuration.remove_rule 'temporary/'
Instance Attribute Summary collapse
- #configuration ⇒ BucketLifecycleConfiguration readonly
- #expiration_time ⇒ Date, Integer (also: #expiration_days)
- #glacier_transition_time ⇒ Date, Integer
- #id ⇒ String readonly
- #prefix ⇒ String
-
#status ⇒ String
Returns the rule status, ‘Enabled’ or ‘Disabled’.
Instance Method Summary collapse
Instance Attribute Details
#configuration ⇒ BucketLifecycleConfiguration (readonly)
356 357 358 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 356 def configuration @configuration end |
#expiration_time ⇒ Date, Integer Also known as: expiration_days
367 368 369 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 367 def expiration_time @expiration_time end |
#glacier_transition_time ⇒ Date, Integer
382 383 384 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 382 def glacier_transition_time @glacier_transition_time end |
#id ⇒ String (readonly)
359 360 361 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 359 def id @id end |
#prefix ⇒ String
362 363 364 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 362 def prefix @prefix end |
#status ⇒ String
Returns the rule status, ‘Enabled’ or ‘Disabled’
390 391 392 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 390 def status @status end |
Instance Method Details
#disabled! ⇒ Object
404 405 406 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 404 def disabled! self.status = 'Disabled' end |
#disabled? ⇒ Boolean
400 401 402 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 400 def disabled? status == 'Disabled' end |
#enable! ⇒ Object
396 397 398 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 396 def enable! self.status = 'Enabled' end |
#enabled? ⇒ Boolean
392 393 394 |
# File 'lib/aws/s3/bucket_lifecycle_configuration.rb', line 392 def enabled? status == 'Enabled' end |