Class: AwsCftTools::Change

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/aws_cft_tools/change.rb

Overview

Represents a change in a changeset.

Direct Known Subclasses

DeletionChange

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(change) ⇒ Change

Returns a new instance of Change.

Parameters:

  • change (Aws::CloudFormation::Types::Change)

    The AWS SDK change object to be wrapped.



13
14
15
# File 'lib/aws_cft_tools/change.rb', line 13

def initialize(change)
  @resource = change.resource_change
end

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



10
11
12
# File 'lib/aws_cft_tools/change.rb', line 10

def resource
  @resource
end

Instance Method Details

#scopesString

Returns a comma-separated list of scopes.

Returns:

  • (String)

    a comma-separated list of scopes



37
38
39
# File 'lib/aws_cft_tools/change.rb', line 37

def scopes
  resource.scope.sort.join(', ')
end

#to_narrativeHash

Returns information useful for creating a tabular report.

Returns:

  • (Hash)

    information useful for creating a tabular report



45
46
47
48
49
50
51
52
53
54
# File 'lib/aws_cft_tools/change.rb', line 45

def to_narrative
  {
    action: action,
    logical_id: logical_id,
    physical_id: physical_id,
    type: type,
    scopes: scopes,
    replacement: replacement
  }
end

#typeString

Returns human readable type of resource being changed.

Examples:

EC2::Network::ACL


"ec2 network acl"

Returns:

  • (String)

    human readable type of resource being changed



29
30
31
# File 'lib/aws_cft_tools/change.rb', line 29

def type
  humanize_camelized(resource.resource_type)
end