Sha256: 87b1807f3edabe7436dc5ee0fb89e1a69f41603f3cf5e526f2d3eeb33c7813ee

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

module JsonapiSpecHelpers
  module Errors
    class Base < StandardError; end
    class IncludedOutOfBounds < Base
      def initialize(type, index, array)
        @type = type; @index = index; @array = array
      end

      def message
        "You attempted to get an item at index #{@index} of the type '#{@type}' " \
        "from the included property of your JSON payload. But it contained "    \
        "#{@array.length} '#{@type}'"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jsonapi_spec_helpers-0.4.10 lib/jsonapi_spec_helpers/errors.rb
jsonapi_spec_helpers-0.4.9 lib/jsonapi_spec_helpers/errors.rb
jsonapi_spec_helpers-0.4.8 lib/jsonapi_spec_helpers/errors.rb