Sha256: 920d36bdeb49e1fd7c339a245352d8de2197580120c31d71f5d6bc811d2e3f86

Contents?: true

Size: 337 Bytes

Versions: 10

Compression:

Stored size: 337 Bytes

Contents

# frozen_string_literal: true

module CheckstyleReports
  class Severity
    VALUES = %i(ignore info warning error).freeze

    def initialize(base)
      @base = base&.to_sym
    end

    def <=(other)
      return if @base.nil?
      return true if other.nil?

      VALUES.index(@base) <= VALUES.index(other.to_sym)
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
danger-space_checkstyle_reports-1.0.3 lib/checkstyle_reports/lib/severity.rb
danger-space_checkstyle_reports-1.0.2 lib/checkstyle_reports/lib/severity.rb
ktlint_reporter-1.0.1 lib/checkstyle_reports/lib/severity.rb
ktlint_reporter-1.0.0 lib/checkstyle_reports/lib/severity.rb
ktlint_reporter-0.1.2 lib/checkstyle_reports/lib/severity.rb
ktlint_reporter-0.1.1 lib/checkstyle_reports/lib/severity.rb
ktlint_reporter-0.1.0 lib/checkstyle_reports/lib/severity.rb
danger-checkstyle_reports-0.1.0 lib/checkstyle_reports/lib/severity.rb
danger-checkstyle_reports-0.0.1.pre.rc02 lib/checkstyle_reports/lib/severity.rb
danger-checkstyle_reports-0.0.1.pre.rc01 lib/checkstyle_reports/lib/severity.rb