Sha256: 91ab576f61dea923db189593ce30203805423ac3f366a7d36a8bc31e487b5e69

Contents?: true

Size: 396 Bytes

Versions: 2

Compression:

Stored size: 396 Bytes

Contents

module Schneiderlein
  class Catch
    delegate :any?, :empty?, to: :errors

    attr_reader :request

    def initialize(request)
      @request = request
    end

    def to_a
      request.env.fetch('rack.schneiderlein.parse_errors', [])
    end

    alias errors to_a

    def to_s
      to_a.map do |exc|
        ExtractREXMLErrorMessage.new(exc).to_s
      end.join(' ')
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
schneiderlein-1.2.0 lib/schneiderlein/catch.rb
schneiderlein-1.1.0 lib/schneiderlein/catch.rb