class ArchSpec::Rules::DependencyRule
Base for the allow and forbid dependency rules. Merges repeated declarations for the same source component.
Attributes
Public Class Methods
Source
# File lib/archspec/rules/dependency_rules.rb, line 15 def initialize(source, targets) @source = source.to_sym @targets = Array(targets).flatten.map(&:to_sym).to_set end
Public Instance Methods
Source
# File lib/archspec/rules/dependency_rules.rb, line 24 def merge!(other) targets.merge(other.targets) self end
Source
# File lib/archspec/rules/dependency_rules.rb, line 20 def merge_key [self.class, source] end