Module: ArchSpec::Rules::Reasoned

Defined in:
lib/archspec/rules/reasoned.rb

Overview

Attaches a human reason to any rule without coupling that metadata to the rule's implementation or to diagnostic fingerprints.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#archspec_becauseObject

Returns the value of attribute archspec_because.



8
9
10
# File 'lib/archspec/rules/reasoned.rb', line 8

def archspec_because
  @archspec_because
end

Instance Method Details

#evaluate(graph) ⇒ Object



22
23
24
# File 'lib/archspec/rules/reasoned.rb', line 22

def evaluate(graph)
  super.map { |diagnostic| diagnostic.with_reason(archspec_because) }
end