Sha256: 17212e2e6dfce95224b0ec675d7723443bd830326df72a829456115c4db5c717
Contents?: true
Size: 570 Bytes
Versions: 9
Compression:
Stored size: 570 Bytes
Contents
require 'roodi/checks/check' module Roodi module Checks class NameCheck < Check def initialize(interesting_nodes, pattern, message_prefix) super() @interesting_nodes = interesting_nodes @pattern = pattern @message_prefix = message_prefix end def interesting_nodes @interesting_nodes end def evaluate(node) name = find_name(node) add_error "#{@message_prefix} name \"#{name}\" should match pattern #{@pattern.inspect}" unless name.to_s =~ @pattern end end end end
Version data entries
9 entries across 9 versions & 2 rubygems