class AWS::S3::BucketLifecycleConfiguration::Rule

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/'

Attributes

configuration[R]

@return [BucketLifecycleConfiguration]

expiration_days[RW]

@return [Integer]

id[R]

@return [String]

prefix[RW]

@return [String]

status[RW]

@return [String] Returns the rule status, ‘Enabled’ or ‘Disabled’

Public Class Methods

new(configuration, id, prefix, expiration_days, status) click to toggle source
# File lib/aws/s3/bucket_lifecycle_configuration.rb, line 305
def initialize configuration, id, prefix, expiration_days, status
  @configuration = configuration
  @id = id
  @prefix = prefix
  @expiration_days = expiration_days
  @status = status
end

Public Instance Methods

==(other) click to toggle source
Alias for: eql?
disabled!() click to toggle source
# File lib/aws/s3/bucket_lifecycle_configuration.rb, line 340
def disabled!
  self.status = 'Disabled'
end
disabled?() click to toggle source
# File lib/aws/s3/bucket_lifecycle_configuration.rb, line 336
def disabled?
  status == 'Disabled'
end
enable!() click to toggle source
# File lib/aws/s3/bucket_lifecycle_configuration.rb, line 332
def enable!
  self.status = 'Enabled'
end
enabled?() click to toggle source
# File lib/aws/s3/bucket_lifecycle_configuration.rb, line 328
def enabled?
  status == 'Enabled'
end
eql?(other) click to toggle source

@private

# File lib/aws/s3/bucket_lifecycle_configuration.rb, line 345
def eql? other
  other.is_a?(Rule) and
  other.configuration.bucket == configuration.bucket and
  other.id == id and
  other.prefix == prefix and
  other.expiration_days == expiration_days and
  other.status == status
end
Also aliased as: ==