Sha256: 198f410773df59555b4aa24f1ca3a0960797da761dc8f88e1938f1762010cd76

Contents?: true

Size: 545 Bytes

Versions: 69

Compression:

Stored size: 545 Bytes

Contents

module CC
  module Analyzer
    module IssueValidations
      class RemediationPointsValidation < Validation
        def valid?
          remediation_points.nil? || positive_integer?(remediation_points)
        end

        def message
          "Remediation points must be a non-negative integer"
        end

        private

        def remediation_points
          @remediation_points ||= object["remediation_points"]
        end

        def positive_integer?(x)
          x.is_a?(Integer) && x >= 0
        end
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
codeclimate-0.85.9 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.8 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.7 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.6 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.5 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.4 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.3 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.2 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.1 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.84.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.83.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.82.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.81.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.80.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.79.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.78.1 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.78.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.77.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.76.0 lib/cc/analyzer/issue_validations/remediation_points_validation.rb