Class: Git::Lint::Validators::Name
- Inherits:
-
Object
- Object
- Git::Lint::Validators::Name
- Defined in:
- lib/git/lint/validators/name.rb
Overview
Validates the format of names.
Constant Summary collapse
- DELIMITER =
/\s{1}/
- MINIMUM =
2
Instance Method Summary collapse
- #call(content, minimum: MINIMUM) ⇒ Object
-
#initialize(delimiter: DELIMITER) ⇒ Name
constructor
A new instance of Name.
Constructor Details
Instance Method Details
#call(content, minimum: MINIMUM) ⇒ Object
19 20 21 22 |
# File 'lib/git/lint/validators/name.rb', line 19 def call content, minimum: MINIMUM parts = String(content).split delimiter parts.size >= minimum && parts.all? { |name| !name.blank? } end |