Class Roodi::Checks::NameCheck
In: lib/roodi/checks/name_check.rb
Parent: Roodi::Checks::Check

Methods

Public Class methods

[Source]

# File lib/roodi/checks/name_check.rb, line 6
      def initialize(interesting_nodes, pattern, message_prefix)
        super()
        @interesting_nodes = interesting_nodes
        @pattern = pattern
        @message_prefix = message_prefix
      end

Public Instance methods

[Source]

# File lib/roodi/checks/name_check.rb, line 17
      def evaluate_start(node)
        name = find_name(node)
        add_error "#{@message_prefix} name \"#{name}\" should match pattern #{@pattern.inspect}" unless name.to_s =~ @pattern
      end

[Source]

# File lib/roodi/checks/name_check.rb, line 13
      def interesting_nodes
        @interesting_nodes
      end

[Validate]