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

Constructor Details

#initialize(object) ⇒ OtherLocationsFormatValidation

Returns a new instance of OtherLocationsFormatValidation.



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

def initialize(object)
  super
  @other_location_valid = {}
end

Instance Method Details

#messageObject



26
27
28
# File 'lib/cc/analyzer/issue_validations/other_locations_format_validation.rb', line 26

def message
  "Other locations are not formatted correctly"
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
24
# File 'lib/cc/analyzer/issue_validations/other_locations_format_validation.rb', line 17

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