class AWS::S3::BucketLifecycleConfiguration

def add_rule prefix, expiration_days, options = {}

Returns:
  • (Rule) - Returns the rule that was added, as a {Rule} object.

Options Hash: (**options)
  • :disabled (Boolean) -- By default, all rules
  • :id (String) -- A unique ID for this rule. If an ID

Parameters:
  • options (Hash) --
  • expiration_days (Integer) -- Indicates the lifetime for objects
  • prefix (String) --
def add_rule prefix, expiration_days, options = {}
  id = options[:id] || UUIDTools::UUID.random_create.to_s
  status = options[:disabled] == true ? 'Disabled' : 'Enabled'
  rule = Rule.new(self, id, prefix, expiration_days, status)
  self.rules << rule
  rule
end