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-fede-0.85.35 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-fede-0.85.33 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-fede-0.85.32 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-fede-0.85.31 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-fede-0.85.30 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-fede-0.85.21 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-fede-0.85.24 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-fede-0.85.23 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.23 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.22 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.21 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.19 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.18 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.17 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.15 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.14 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.13 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.12 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.11 lib/cc/analyzer/issue_validations/remediation_points_validation.rb
codeclimate-0.85.10 lib/cc/analyzer/issue_validations/remediation_points_validation.rb