Class: Droonga::CRUDOutputAdapter
- Inherits:
-
OutputAdapterPlugin
- Object
- Plugin
- OutputAdapterPlugin
- Droonga::CRUDOutputAdapter
- Defined in:
- lib/droonga/plugin/output_adapter/crud.rb
Instance Method Summary collapse
Methods inherited from OutputAdapterPlugin
Methods included from PluginRegisterable
#command, extended, #inherited, #method_name, #processable?, #repository
Methods inherited from Plugin
#initialize, #process, #processable?, #shutdown, #start
Constructor Details
This class inherits a constructor from Droonga::OutputAdapterPlugin
Instance Method Details
#crud_generic_response(output_message) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/droonga/plugin/output_adapter/crud.rb', line 23 def crud_generic_response() if .body.include?("errors") errors = .body["errors"] if errors && !errors.empty? .errors = errors status_codes = [] errors.values.each do |error| status_codes << error["statusCode"] end status_codes = status_codes.uniq if status_codes.size == 1 .status_code = status_codes.first else .status_code = MessageProcessingError::STATUS_CODE end .body = errors.values.first["body"] end end if .body.include?("success") success = .body["success"] unless success.nil? .body = .body["success"] end end end |