class AWS::S3::BucketLifecycleConfiguration::Rule
bucket.lifecycle_configuration.remove_rule ‘temporary/’
# remove the rule created above
bucket.lifecycle_configuration.add_rule ‘temporary/’, 10
# delete all objects with the prefix ‘temporary/’ after 10 days
configuration.
Represents a single rule from an Amazon S3 bucket lifecycle
def convert_time_value(value)
-
(nil)
- if the value is nil -
(Date)
- if the value is a time-like object -
(Integer)
- if the value is an integer
def convert_time_value(value) return nil if value.nil? return value if value.is_a?(Integer) Date.parse(value.to_s) end
def disabled!
def disabled! self.status = 'Disabled' end
def disabled?
def disabled? status == 'Disabled' end
def enable!
def enable! self.status = 'Enabled' end
def enabled?
def enabled? status == 'Enabled' end
def eql? other
- Api: - private
def eql? other other.is_a?(Rule) and other.configuration.bucket == configuration.bucket and other.id == id and other.prefix == prefix and other.expiration_time == expiration_time and other.glacier_transition_time == glacier_transition_time and other.status == status end
def expiration_time=(value)
def expiration_time=(value) @expiration_time = convert_time_value(value) end
def glacier_transition_time=(value)
def glacier_transition_time=(value) @glacier_transition_time = convert_time_value(value) end
def initialize configuration, id, prefix, expiration_time = nil, status = nil
- Api: - private
def initialize configuration, id, prefix, expiration_time = nil, status = nil @configuration = configuration @id = id @prefix = prefix if Hash === expiration_time options = expiration_time options.each do |key, value| send("#{key}=", value) if respond_to?("#{key}=") end else self.expiration_time = expiration_time self.status = status end end