Sha256: bc5935a2e2b77bb7f52698d03a009c694ee155f36c18ba630d1089d398677881
Contents?: true
Size: 567 Bytes
Versions: 12
Compression:
Stored size: 567 Bytes
Contents
require 'roodi/checks/name_check' module Roodi module Checks # Checks a method name to make sure it matches the specified pattern. # # Keeping to a consistent nameing convention makes your code easier to read. class MethodNameCheck < NameCheck DEFAULT_PATTERN = /^[_a-z<>=\[|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/ def initialize(options = {}) pattern = options['pattern'] || DEFAULT_PATTERN super([:defn], pattern, 'Method') end def find_name(node) node[1] end end end end
Version data entries
12 entries across 12 versions & 3 rubygems