Class: Cumulus::S3::LifecycleDiff

Inherits:
Common::Diff show all
Includes:
LifecycleChange
Defined in:
lib/s3/models/LifecycleDiff.rb

Overview

Public: Represents a single difference between local configuration and AWS lifecycle rule configuration

Constant Summary

Constants included from LifecycleChange

Cumulus::S3::LifecycleChange::DAYS_UNTIL_DELETE, Cumulus::S3::LifecycleChange::DAYS_UNTIL_GLACIER, Cumulus::S3::LifecycleChange::PAST_UNTIL_DELETE, Cumulus::S3::LifecycleChange::PAST_UNTIL_GLACIER, Cumulus::S3::LifecycleChange::PREFIX

Constants included from Common::DiffChange

Common::DiffChange::ADD, Common::DiffChange::MODIFIED, Common::DiffChange::UNMANAGED

Instance Attribute Summary

Attributes inherited from Common::Diff

#aws, #changes, #info_only, #local, #type

Instance Method Summary collapse

Methods included from Common::DiffChange

next_change_id

Methods inherited from Common::Diff

#add_string, added, #initialize, #local_name, modified, #to_s, unmanaged, #unmanaged_string

Constructor Details

This class inherits a constructor from Cumulus::Common::Diff

Instance Method Details

#asset_typeObject



22
23
24
# File 'lib/s3/models/LifecycleDiff.rb', line 22

def asset_type
  "Lifecycle rule"
end

#aws_nameObject



26
27
28
# File 'lib/s3/models/LifecycleDiff.rb', line 26

def aws_name
  @aws.name
end

#diff_stringObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/s3/models/LifecycleDiff.rb', line 30

def diff_string
  case @type
  when DAYS_UNTIL_DELETE
    "Days before objects are deleted: AWS - #{Colors.aws_changes(@aws.days_until_delete)}, Local - #{Colors.local_changes(@local.days_until_delete)}"
  when DAYS_UNTIL_GLACIER
    "Days before transition to Glacier: AWS - #{Colors.aws_changes(@aws.days_until_glacier)}, Local - #{Colors.local_changes(@local.days_until_glacier)}"
  when PAST_UNTIL_DELETE
    "Days before past version objects are deleted: AWS - #{Colors.aws_changes(@aws.past_days_until_delete)}, Local - #{Colors.local_changes(@local.past_days_until_delete)}"
  when PAST_UNTIL_GLACIER
    "Days before past version transition to Glacier: AWS - #{Colors.aws_changes(@aws.past_days_until_glacier)}, Local - #{Colors.local_changes(@local.past_days_until_glacier)}"
  when PREFIX
    "Prefix - AWS #{Colors.aws_changes(@aws.prefix)}, Local - #{Colors.local_changes(@local.prefix)}"
  end
end