Exception: Esse::Transport::BulkResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/esse/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ BulkResponseError

Returns a new instance of BulkResponseError.



21
22
23
24
# File 'lib/esse/errors.rb', line 21

def initialize(response)
  @response = response
  super(response)
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



19
20
21
# File 'lib/esse/errors.rb', line 19

def response
  @response
end

Instance Method Details

#itemsObject



26
27
28
# File 'lib/esse/errors.rb', line 26

def items
  response.fetch('items', []).select { |item| item.values.dig(0, 'error') }
end