Class: Git::Lint::Validators::Capitalization
- Inherits:
-
Object
- Object
- Git::Lint::Validators::Capitalization
- Defined in:
- lib/git/lint/validators/capitalization.rb
Constant Summary collapse
- DEFAULT_PATTERN =
/\A[[:upper:]].*\Z/
Instance Method Summary collapse
-
#initialize(text, delimiter: Name::DEFAULT_DELIMITER, pattern: DEFAULT_PATTERN) ⇒ Capitalization
constructor
A new instance of Capitalization.
- #valid? ⇒ Boolean
Constructor Details
#initialize(text, delimiter: Name::DEFAULT_DELIMITER, pattern: DEFAULT_PATTERN) ⇒ Capitalization
Returns a new instance of Capitalization.
9 10 11 12 13 |
# File 'lib/git/lint/validators/capitalization.rb', line 9 def initialize text, delimiter: Name::DEFAULT_DELIMITER, pattern: DEFAULT_PATTERN @text = String text @delimiter = delimiter @pattern = pattern end |
Instance Method Details
#valid? ⇒ Boolean
15 16 17 |
# File 'lib/git/lint/validators/capitalization.rb', line 15 def valid? parts.all? { |name| String(name).match? pattern } end |