class AWS::S3::BucketLifecycleConfiguration

def replace &block


bucket.lifecycle_configuration.rules.size #=> 1

end
add_rule 'temp/', 10
bucket.lifecycle_configuration.replace
# replace the existing 3 rules with a single rule

bucket.lifecycle_configuration.rules.size #=> 3

the new rules.
When the block is complete, a single call will be made to save

new rules.
rules will be blanked out. This allows you to provide all
Yields to the given block. Before yielding, the current
def replace &block
  @rules = []
  update(&block)
end