Class: CC::Analyzer::IssueValidations::OtherLocationsFormatValidation

Inherits:
Validation
  • Object
show all
Defined in:
lib/cc/analyzer/issue_validations/other_locations_format_validation.rb

Constant Summary collapse

CHECKS =
[
  LocationFormatValidation,
  PathExistenceValidation,
  PathPresenceValidation,
  RelativePathValidation,
].freeze

Instance Method Summary collapse

Methods inherited from Validation

#initialize

Constructor Details

This class inherits a constructor from CC::Analyzer::IssueValidations::Validation

Instance Method Details

#messageObject



21
22
23
# File 'lib/cc/analyzer/issue_validations/other_locations_format_validation.rb', line 21

def message
  "Other locations are not formatted correctly"
end

#valid?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
# File 'lib/cc/analyzer/issue_validations/other_locations_format_validation.rb', line 12

def valid?
  if object["other_locations"]
    object["other_locations"].is_a?(Array) &&
      object["other_locations"].all?(&method(:other_location_valid?))
  else
    true
  end
end