Method: Imperium::KVGETResponse#found_objects

Defined in:
lib/imperium/kv_get_response.rb

#found_objectsnil, Array<KVPair>

Construct an Array of KV pairs from a response, including their full metadata.

Returns:

  • (nil)

    When the keys option was supplied.

  • (Array<KVPair>)

    When there are values present, and an empty array when the response is a 404.



30
31
32
33
34
# File 'lib/imperium/kv_get_response.rb', line 30

def found_objects
  return if options.key?(:keys)
  return [] if not_found?
  @found_objects ||= parsed_body.map { |attrs| KVPair.new(attrs) }
end