Class: PolicyDocumentMetric

Inherits:
Object show all
Defined in:
lib/cfn-nag/iam_complexity_metric/policy_document_metric.rb

Instance Method Summary collapse

Instance Method Details

#metric(policy_document) ⇒ Object


6
7
8
9
10
# File 'lib/cfn-nag/iam_complexity_metric/policy_document_metric.rb', line 6

def metric(policy_document)
  policy_document.statements.reduce(0) do |aggregate, statement|
    aggregate + StatementMetric.new.metric(statement)
  end
end