class Groonga::Client::Response::Load

Attributes

errors[RW]

@return [::Array<Groonga::Client::Response::Load::Error>]

The errors of loaded records. `error.return_code` isn't
`0` if the corresponding record is failed to load.

If you don't specify `yes` to `output_errors` `load`
parameter, this is always an empty array.

@since 0.4.1

loaded_ids[RW]

@return [::Array<Integer>] The IDs of loaded records. ID is

`0` if the corresponding record is failed to add.

If you don't specify `yes` to `output_ids` `load`
parameter, this is always an empty array.

@since 0.3.3

n_loaded_records[RW]

@return [Integer] The number of loaded records.

@since 0.3.2

Public Instance Methods

body=(body) click to toggle source
Calls superclass method
# File lib/groonga/client/response/load.rb, line 50
def body=(body)
  super(body)
  parse_body(body)
end

Private Instance Methods

parse_body(body) click to toggle source
# File lib/groonga/client/response/load.rb, line 56
def parse_body(body)
  if body.is_a?(::Hash)
    @n_loaded_records = body["n_loaded_records"]
    @loaded_ids = body["loaded_ids"] || []
    @errors = (body["errors"] || []).collect do |error|
      Error.new(error["return_code"] || 0,
                error["message"])
    end
  else
    @n_loaded_records = body
    @loaded_ids = []
    @errors = []
  end
end