class ArchSpec::Rules::Naming::NameSelector
Selects methods whose name matches a regex. A named capture in the regex (such as (?<base>.+)) is exposed to the requires constraint.
Attributes
Public Class Methods
Source
# File lib/archspec/rules/naming_rules.rb, line 54 def initialize(regex) @regex = regex end
Public Instance Methods
Source
# File lib/archspec/rules/naming_rules.rb, line 62 def describe "matches #{regex.inspect}" end
Source
# File lib/archspec/rules/naming_rules.rb, line 58 def match(definition) regex.match(definition.name.to_s) end