Class: Cumulus::Route53::RecordDiff
- Inherits:
-
Common::Diff
- Object
- Common::Diff
- Cumulus::Route53::RecordDiff
- Includes:
- RecordChange
- Defined in:
- lib/route53/models/RecordDiff.rb
Overview
Public: Represents differences between local configuration and AWS configuration for records.
Constant Summary
Constants included from RecordChange
Cumulus::Route53::RecordChange::ALIAS, Cumulus::Route53::RecordChange::CHANGED, Cumulus::Route53::RecordChange::DEFAULT, Cumulus::Route53::RecordChange::IGNORED, Cumulus::Route53::RecordChange::TTL, Cumulus::Route53::RecordChange::VALUE
Constants included from Common::DiffChange
Common::DiffChange::ADD, Common::DiffChange::MODIFIED, Common::DiffChange::UNMANAGED
Instance Attribute Summary collapse
-
#changes ⇒ Object
Returns the value of attribute changes.
-
#message ⇒ Object
Returns the value of attribute message.
Attributes inherited from Common::Diff
#aws, #info_only, #local, #type
Class Method Summary collapse
-
.changed(changes, local) ⇒ Object
Public: Static method that will create a diff that contains a bunch of singular changes.
-
.default(message, aws) ⇒ Object
Public: Static method that will create a diff that contains a message but is ignored when syncing because it is a default record.
-
.ignored(message, aws) ⇒ Object
Public: Static method that will create a diff that contains a message but is ignored when syncing.
Instance Method Summary collapse
Methods included from Common::DiffChange
Methods inherited from Common::Diff
#add_string, added, #initialize, modified, #to_s, unmanaged, #unmanaged_string
Constructor Details
This class inherits a constructor from Cumulus::Common::Diff
Instance Attribute Details
#changes ⇒ Object
Returns the value of attribute changes.
25 26 27 |
# File 'lib/route53/models/RecordDiff.rb', line 25 def changes @changes end |
#message ⇒ Object
Returns the value of attribute message.
24 25 26 |
# File 'lib/route53/models/RecordDiff.rb', line 24 def @message end |
Class Method Details
.changed(changes, local) ⇒ Object
Public: Static method that will create a diff that contains a bunch of singular changes.
changes - the changes for the record local - the local configuration for the record
Returns the diff
61 62 63 64 65 |
# File 'lib/route53/models/RecordDiff.rb', line 61 def self.changed(changes, local) diff = RecordDiff.new(CHANGED, nil, local) diff.changes = changes diff end |
.default(message, aws) ⇒ Object
Public: Static method that will create a diff that contains a message but is ignored when syncing because it is a default record.
message - the message to display aws - the aws configuration for the record
Returns the diff
34 35 36 37 38 |
# File 'lib/route53/models/RecordDiff.rb', line 34 def self.default(, aws) diff = RecordDiff.new(DEFAULT, aws) diff. = diff end |
.ignored(message, aws) ⇒ Object
Public: Static method that will create a diff that contains a message but is ignored when syncing.
message - the message to display aws - the aws configuration for the record
Returns the diff
47 48 49 50 51 52 |
# File 'lib/route53/models/RecordDiff.rb', line 47 def self.ignored(, aws) diff = RecordDiff.new(IGNORED, aws) diff. = diff.info_only = true diff end |
Instance Method Details
#asset_type ⇒ Object
67 68 69 |
# File 'lib/route53/models/RecordDiff.rb', line 67 def asset_type "Record" end |
#aws_name ⇒ Object
71 72 73 |
# File 'lib/route53/models/RecordDiff.rb', line 71 def aws_name "(#{@aws.type}) #{@aws.name}" end |
#diff_string ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/route53/models/RecordDiff.rb', line 79 def diff_string case @type when IGNORED when DEFAULT when CHANGED [ "Record #{local_name}:", changes.map { |c| "\t\t#{c}" } ].flatten.join("\n") end end |
#local_name ⇒ Object
75 76 77 |
# File 'lib/route53/models/RecordDiff.rb', line 75 def local_name @local.readable_name end |