Exception: JsonapiSpecHelpers::Errors::IncludedOutOfBounds

Inherits:
Base
  • Object
show all
Defined in:
lib/jsonapi_spec_helpers/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, index, array) ⇒ IncludedOutOfBounds

Returns a new instance of IncludedOutOfBounds.



5
6
7
# File 'lib/jsonapi_spec_helpers/errors.rb', line 5

def initialize(type, index, array)
  @type = type; @index = index; @array = array
end

Instance Method Details

#messageObject



9
10
11
12
13
# File 'lib/jsonapi_spec_helpers/errors.rb', line 9

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