Sha256: 58bc24e964ecf38be8d7d7bc7b57c5db6a3efb7c9dc20502c77f4eb4958e4ab9

Contents?: true

Size: 463 Bytes

Versions: 3

Compression:

Stored size: 463 Bytes

Contents

module Danger
  module Changelog
    module Parsers
      class ValidationResult
        def initialize
          @errors = []
        end

        attr_reader :errors

        def valid?
          errors.empty?
        end

        def invalid?
          !valid?
        end

        def error!(message)
          errors << message
        end

        def to_s
          return nil if valid?

          errors.join(', ')
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danger-changelog-0.7.1 lib/changelog/parsers/validation_result.rb
danger-changelog-0.7.0 lib/changelog/parsers/validation_result.rb
danger-changelog-0.6.1 lib/changelog/parsers/validation_result.rb