Class Roodi::Checks::ClassNameCheck
In: lib/roodi/checks/class_name_check.rb
Parent: Roodi::Checks::NameCheck

Checks a class name to make sure it matches the specified pattern.

Keeping to a consistent naming convention makes your code easier to read.

Methods

find_name   new  

Constants

DEFAULT_PATTERN = /^[A-Z][a-zA-Z0-9]*$/

Public Class methods

[Source]

# File lib/roodi/checks/class_name_check.rb, line 11
      def initialize(options = {})
        pattern = options['pattern'] || DEFAULT_PATTERN
        super([:class], pattern, 'Class')
      end

Public Instance methods

[Source]

# File lib/roodi/checks/class_name_check.rb, line 16
      def find_name(node)
        node[1].class == Symbol ? node[1] : node[1].last
      end

[Validate]